summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-04 12:29:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-04 12:29:52 +0000
commit1b923819e8305bfe324c9c59e745f61c9c49ef06 (patch)
tree3acd758bc119e68b2c41dcfb9d6b35d163d4d64b
parent7dbc3e4774f2c405a7f2784c93160066a6c88303 (diff)
downloadredmine-1b923819e8305bfe324c9c59e745f61c9c49ef06.tar.gz
redmine-1b923819e8305bfe324c9c59e745f61c9c49ef06.zip
Removed some generate! calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9079 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/versions_controller_test.rb2
-rw-r--r--test/integration/api_test/disabled_rest_api_test.rb4
-rw-r--r--test/integration/api_test/issues_test.rb6
-rw-r--r--test/unit/wiki_test.rb2
4 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index fe5d3f895..fb6de5785 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -70,7 +70,7 @@ class VersionsControllerTest < ActionController::TestCase
end
def test_index_showing_subprojects_versions
- @subproject_version = Version.generate!(:project => Project.find(3))
+ @subproject_version = Version.create!(:project => Project.find(3), :name => "Subproject version")
get :index, :project_id => 1, :with_subprojects => 1
assert_response :success
assert_template 'index'
diff --git a/test/integration/api_test/disabled_rest_api_test.rb b/test/integration/api_test/disabled_rest_api_test.rb
index 8683846f0..5ec1f22b9 100644
--- a/test/integration/api_test/disabled_rest_api_test.rb
+++ b/test/integration/api_test/disabled_rest_api_test.rb
@@ -22,7 +22,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
def test_with_a_valid_api_token
@user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
+ @token = Token.create!(:user => @user, :action => 'api')
get "/news.xml?key=#{@token.value}"
assert_response :unauthorized
@@ -47,7 +47,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
def test_with_valid_token_http_authentication
@user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
+ @token = Token.create!(:user => @user, :action => 'api')
get "/news.xml", nil, credentials(@token.value, 'X')
assert_response :unauthorized
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index 1c6e49b17..4445a000d 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -387,9 +387,9 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
context "with subtasks" do
setup do
- @c1 = Issue.generate!(:status_id => 1, :subject => "child c1", :tracker_id => 1, :project_id => 1, :parent_issue_id => 1)
- @c2 = Issue.generate!(:status_id => 1, :subject => "child c2", :tracker_id => 1, :project_id => 1, :parent_issue_id => 1)
- @c3 = Issue.generate!(:status_id => 1, :subject => "child c3", :tracker_id => 1, :project_id => 1, :parent_issue_id => @c1.id)
+ @c1 = Issue.create!(:status_id => 1, :subject => "child c1", :tracker_id => 1, :project_id => 1, :author_id => 1, :parent_issue_id => 1)
+ @c2 = Issue.create!(:status_id => 1, :subject => "child c2", :tracker_id => 1, :project_id => 1, :author_id => 1, :parent_issue_id => 1)
+ @c3 = Issue.create!(:status_id => 1, :subject => "child c3", :tracker_id => 1, :project_id => 1, :author_id => 1, :parent_issue_id => @c1.id)
end
context ".xml" do
diff --git a/test/unit/wiki_test.rb b/test/unit/wiki_test.rb
index 6b0f6d2be..923ff528e 100644
--- a/test/unit/wiki_test.rb
+++ b/test/unit/wiki_test.rb
@@ -56,7 +56,7 @@ class WikiTest < ActiveSupport::TestCase
def test_find_page_with_backslashes
wiki = Wiki.find(1)
- page = WikiPage.generate!(:wiki => wiki, :title => '2009\\02\\09')
+ page = WikiPage.create!(:wiki => wiki, :title => '2009\\02\\09')
assert_equal page, wiki.find_page('2009\\02\\09')
end