Skip to content

Commit

Permalink
Sets up user not logged in shared example.
Browse files Browse the repository at this point in the history
  • Loading branch information
dacur authored and seanmarcia committed Dec 5, 2018
1 parent dd6d67a commit 5c38af6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove this line.
Expand Down
6 changes: 6 additions & 0 deletions spec/support/shared_examples/user_not_logged_in.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
shared_examples_for "user is not logged in" do
it "returns a 302 redirect" do
subject
expect(response).to have_http_status(302)
end
end

0 comments on commit 5c38af6

Please sign in to comment.