Sha256: 20ee8a662f6e841ea947cfcc40e37a7ecbbb98f10530db053a9dfb86a038a187
Contents?: true
Size: 991 Bytes
Versions: 18
Compression:
Stored size: 991 Bytes
Contents
require 'test_helper' class PostsControllerTest < ActionController::TestCase include Devise::TestHelpers context "not logged in" do should "should get INDEX" do get :index assert_response :success assert_equal(response.body, "posts#index") end context "go to NEW page" do setup do get :new end should "not get NEW" do assert_response :redirect end end end context "logged in" do setup do @user = Factory(:user) sign_in(@user) end context "get NEW action" do setup do get :new end should "get the NEW action" do assert_response :success assert_equal(response.body, "posts#new") end end context "log out user" do setup do sign_out(@user) get :new end should "get redirected to the login page" do assert_response :redirect end end end end
Version data entries
18 entries across 18 versions & 3 rubygems