fix functional tests
This commit is contained in:
@@ -12,7 +12,7 @@ class Admin::UsersControllerTest < ActionController::TestCase
|
||||
|
||||
context "#edit" do
|
||||
should "render" do
|
||||
get :edit, {:id => @user.id}
|
||||
get :edit, {:id => @user.id}, {:user_id => @mod.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
@@ -20,7 +20,7 @@ class Admin::UsersControllerTest < ActionController::TestCase
|
||||
context "#update" do
|
||||
context "on a basic user" do
|
||||
should "succeed" do
|
||||
put :update, {:id => @user.id, :user => {:level => "30"}}
|
||||
put :update, {:id => @user.id, :user => {:level => "30"}}, {:user_id => @mod.id}
|
||||
assert_redirected_to(edit_admin_user_path(@user))
|
||||
@user.reload
|
||||
assert_equal(30, @user.level)
|
||||
@@ -29,7 +29,7 @@ class Admin::UsersControllerTest < ActionController::TestCase
|
||||
|
||||
context "promoted to an admin" do
|
||||
should "fail" do
|
||||
put :update, {:id => @user.id, :user => {:level => "50"}}
|
||||
put :update, {:id => @user.id, :user => {:level => "50"}}, {:user_id => @mod.id}
|
||||
assert_redirected_to(new_session_path)
|
||||
@user.reload
|
||||
assert_equal(20, @user.level)
|
||||
|
||||
@@ -26,7 +26,7 @@ module Moderator
|
||||
end
|
||||
|
||||
should "list invites" do
|
||||
get :index
|
||||
get :index, {}, {:user_id => @mod.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -69,7 +69,7 @@ class NotesControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "revert to a previous version" do
|
||||
post :revert, {:id => @note.id, :version_id => @note.versions(true).first.id}
|
||||
post :revert, {:id => @note.id, :version_id => @note.versions(true).first.id}, {:user_id => @user.id}
|
||||
@note.reload
|
||||
assert_equal("000", @note.body)
|
||||
end
|
||||
|
||||
@@ -100,7 +100,7 @@ class PoolsControllerTest < ActionController::TestCase
|
||||
assert_equal(2, PoolVersion.count)
|
||||
version = @pool.versions(true).first
|
||||
assert_equal("#{@post.id}", version.post_ids)
|
||||
post :revert, {:id => @pool.id, :version_id => version.id}
|
||||
post :revert, {:id => @pool.id, :version_id => version.id}, {:user_id => @mod.id}
|
||||
@pool.reload
|
||||
assert_equal("#{@post.id}", @pool.post_ids)
|
||||
end
|
||||
|
||||
@@ -18,14 +18,14 @@ class TagAliasCorrectionsControllerTest < ActionController::TestCase
|
||||
|
||||
context "show action" do
|
||||
should "render" do
|
||||
get :show, {:tag_alias_id => @tag_alias.id}, {:user => @admin.id}
|
||||
get :show, {:tag_alias_id => @tag_alias.id}, {:user_id => @admin.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
context "create action" do
|
||||
should "render" do
|
||||
post :create, {:tag_alias_id => @tag_alias.id, :commit => "Fix"}, {:user => @admin.id}
|
||||
post :create, {:tag_alias_id => @tag_alias.id, :commit => "Fix"}, {:user_id => @admin.id}
|
||||
assert_redirected_to(tag_alias_correction_path(:tag_alias_id => @tag_alias.id))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ class TagAliasRequestsControllerTest < ActionController::TestCase
|
||||
|
||||
context "new action" do
|
||||
should "render" do
|
||||
get :new, {}, {:user => @user.id}
|
||||
get :new, {}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
@@ -25,7 +25,7 @@ class TagAliasRequestsControllerTest < ActionController::TestCase
|
||||
context "create action" do
|
||||
should "render" do
|
||||
assert_difference("ForumTopic.count", 1) do
|
||||
post :create, {:tag_alias_request => {:antecedent_name => "aaa", :consequent_name => "bbb", :reason => "ccc"}}, {:user => @user.id}
|
||||
post :create, {:tag_alias_request => {:antecedent_name => "aaa", :consequent_name => "bbb", :reason => "ccc"}}, {:user_id => @user.id}
|
||||
end
|
||||
assert_redirected_to(forum_topic_path(ForumTopic.last))
|
||||
end
|
||||
|
||||
@@ -21,12 +21,12 @@ class TagAliasesControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all tag aliass" do
|
||||
get :index
|
||||
get :index, {}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "list all tag_aliass (with search)" do
|
||||
get :index, {:search => {:antecedent_name => "aaa"}}
|
||||
get :index, {:search => {:antecedent_name => "aaa"}}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -89,7 +89,7 @@ class WikiPagesControllerTest < ActionController::TestCase
|
||||
should "revert to a previous version" do
|
||||
version = @wiki_page.versions(true).first
|
||||
assert_equal("1", version.body)
|
||||
post :revert, {:id => @wiki_page.id, :version_id => version.id}
|
||||
post :revert, {:id => @wiki_page.id, :version_id => version.id}, {:user_id => @user.id}
|
||||
@wiki_page.reload
|
||||
assert_equal("1", @wiki_page.body)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user