Sha256: 1bdf34724524e3f863b56cd2da35451c2d49b31842d6db6673ddfa890af6f648
Contents?: true
Size: 709 Bytes
Versions: 8
Compression:
Stored size: 709 Bytes
Contents
require 'rails_helper' module Pwb RSpec.describe "Sessions", type: :request do before(:all) do @agency = Agency.last || FactoryGirl.create(:pwb_agency, company_name: 'my re') @admin_user = User.create!(email: "user@example.org", password: "very-secret", admin: true) end it "signs user in and out" do sign_in @admin_user get pwb.admin_path # byebug expect(controller.current_user).to eq(@admin_user) sign_out @admin_user get "/admin" # expect(controller.current_user).to be_nil expect(response).to redirect_to(pwb.new_user_session_path) end after(:all) do @agency.destroy @admin_user.destroy end end end
Version data entries
8 entries across 8 versions & 1 rubygems