Removed some generate! calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9078 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
bcd8c64384
commit
7dbc3e4774
|
@ -52,7 +52,7 @@ class AuthSourcesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_edit
|
||||
auth_source = AuthSource.generate!(:name => 'TestEdit')
|
||||
auth_source = AuthSource.create!(:name => 'TestEdit')
|
||||
get :edit, :id => auth_source.id
|
||||
|
||||
assert_response :success
|
||||
|
@ -61,7 +61,7 @@ class AuthSourcesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_update
|
||||
auth_source = AuthSource.generate!(:name => 'TestEdit')
|
||||
auth_source = AuthSource.create!(:name => 'TestEdit')
|
||||
post :update, :id => auth_source.id, :auth_source => {:name => 'TestUpdate'}
|
||||
|
||||
assert_redirected_to '/auth_sources'
|
||||
|
@ -69,7 +69,7 @@ class AuthSourcesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_destroy_without_users
|
||||
auth_source = AuthSource.generate!(:name => 'TestEdit')
|
||||
auth_source = AuthSource.create!(:name => 'TestEdit')
|
||||
assert_difference 'AuthSource.count', -1 do
|
||||
post :destroy, :id => auth_source.id
|
||||
end
|
||||
|
@ -78,8 +78,8 @@ class AuthSourcesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_destroy_with_users
|
||||
auth_source = AuthSource.generate!(:name => 'TestEdit')
|
||||
User.generate!(:auth_source => auth_source)
|
||||
auth_source = AuthSource.create!(:name => 'TestEdit')
|
||||
User.find(2).update_attribute :auth_source, auth_source
|
||||
assert_no_difference 'AuthSource.count' do
|
||||
post :destroy, :id => auth_source.id
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ class CalendarsControllerTest < ActionController::TestCase
|
|||
|
||||
context "GET :show" do
|
||||
should "run custom queries" do
|
||||
@query = Query.generate_default!(:is_public => true)
|
||||
@query = Query.create!(:name => 'Calendar', :is_public => true)
|
||||
|
||||
get :show, :query_id => @query.id
|
||||
assert_response :success
|
||||
|
|
|
@ -328,8 +328,8 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_index_csv_with_spent_time_column
|
||||
issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :subject => 'test_index_csv_with_spent_time_column')
|
||||
TimeEntry.generate!(:project_id => issue.project_id, :issue_id => issue.id, :hours => 7.33)
|
||||
issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'test_index_csv_with_spent_time_column', :author_id => 2)
|
||||
TimeEntry.create!(:project => issue.project, :issue => issue, :hours => 7.33, :user => User.find(2), :spent_on => Date.today)
|
||||
|
||||
get :index, :format => 'csv', :set_filter => '1', :c => %w(subject spent_hours)
|
||||
assert_response :success
|
||||
|
@ -957,7 +957,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_show_should_list_subtasks
|
||||
Issue.generate!(:project_id => 1, :author_id => 1, :tracker_id => 1, :parent_issue_id => 1, :subject => 'Child Issue')
|
||||
Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :parent_issue_id => 1, :subject => 'Child Issue')
|
||||
|
||||
get :show, :id => 1
|
||||
assert_response :success
|
||||
|
@ -966,7 +966,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_show_should_list_parents
|
||||
issue = Issue.generate!(:project_id => 1, :author_id => 1, :tracker_id => 1, :parent_issue_id => 1, :subject => 'Child Issue')
|
||||
issue = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :parent_issue_id => 1, :subject => 'Child Issue')
|
||||
|
||||
get :show, :id => issue.id
|
||||
assert_response :success
|
||||
|
@ -3085,8 +3085,8 @@ class IssuesControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_destroy_parent_and_child_issues
|
||||
parent = Issue.generate!(:project_id => 1, :tracker_id => 1)
|
||||
child = Issue.generate!(:project_id => 1, :tracker_id => 1, :parent_issue_id => parent.id)
|
||||
parent = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Parent Issue')
|
||||
child = Issue.create!(:project_id => 1, :author_id => 1, :tracker_id => 1, :subject => 'Child Issue', :parent_issue_id => parent.id)
|
||||
assert child.is_descendant_of?(parent.reload)
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
|
|
|
@ -476,9 +476,10 @@ class MailerTest < ActiveSupport::TestCase
|
|||
|
||||
def test_reminders_should_not_include_closed_issues
|
||||
with_settings :default_language => 'en' do
|
||||
Issue.generate!(:project_id => 1, :tracker_id => 1, :status_id => 5,
|
||||
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 5,
|
||||
:subject => 'Closed issue', :assigned_to_id => 3,
|
||||
:due_date => 5.days.from_now)
|
||||
:due_date => 5.days.from_now,
|
||||
:author_id => 2)
|
||||
ActionMailer::Base.deliveries.clear
|
||||
|
||||
Mailer.reminders(:days => 42)
|
||||
|
|
Loading…
Reference in New Issue