Permalink
Browse files

Remove view assertions from controller tests and other unnecessary

macros
  • Loading branch information...
1 parent 5d0eae0 commit 7eb98af7b322a1d8db80c6b0964f7fc6ae1ec846 @joshuaclayton joshuaclayton committed Jun 11, 2010
@@ -89,8 +89,11 @@ class ConfirmationsControllerTest < ActionController::TestCase
should set_the_flash.to(/already confirmed/i)
should set_the_flash.to(/sign in/i)
- should_not_be_signed_in
should_redirect_to_url_already_confirmed
+
+ should "not be signed in" do
+ assert_nil cookies[:remember_token]
+ end
end
context "no users" do
@@ -83,7 +83,6 @@ class PasswordsControllerTest < ActionController::TestCase
should respond_with(:success)
should render_template(:edit)
- should_display_a_password_update_form
end
should_forbid "on GET to #edit with correct id but blank token" do
@@ -151,12 +150,13 @@ class PasswordsControllerTest < ActionController::TestCase
assert_not_nil @user.confirmation_token
end
- should_not_be_signed_in
+ should "not be signed in" do
+ assert_nil cookies[:remember_token]
+ end
+
should_not set_the_flash
should respond_with(:success)
should render_template(:edit)
-
- should_display_a_password_update_form
end
should_forbid "on PUT to #update with id but no token" do
@@ -11,7 +11,6 @@ class SessionsControllerTest < ActionController::TestCase
should respond_with(:success)
should render_template(:new)
should_not set_the_flash
- should_display_a_sign_in_form
end
context "on POST to #create with unconfirmed credentials" do
@@ -144,10 +143,9 @@ class SessionsControllerTest < ActionController::TestCase
should set_the_flash.to(/bad/i)
should respond_with(:unauthorized)
should render_template(:new)
- should_not_be_signed_in
- should 'not create the cookie' do
- assert_nil cookies['remember_token']
+ should "not be signed in" do
+ assert_nil cookies[:remember_token]
end
end
@@ -15,8 +15,6 @@ class UsersControllerTest < ActionController::TestCase
should respond_with(:success)
should render_template(:new)
should_not set_the_flash
-
- should_display_a_sign_up_form
end
context "on GET to #new with email" do
@@ -50,7 +48,12 @@ class UsersControllerTest < ActionController::TestCase
end
end
- signed_in_user_context do
+ context "A signed-in user" do
+ setup do
+ @user = Factory(:email_confirmed_user)
+ sign_in_as @user
+ end
+
context "GET to new" do
setup { get :new }
should redirect_to("the home page") { root_url }

0 comments on commit 7eb98af

Please sign in to comment.