spec/integration/controller_helpers_spec.rb in warden-github-rails-1.0.0 vs spec/integration/controller_helpers_spec.rb in warden-github-rails-1.0.1
- old
+ new
@@ -9,85 +9,85 @@
describe '#github_authenticate!' do
subject(:request) { get "/#{type}/authenticate" }
context 'when not logged in' do
it 'initiates the oauth flow' do
- request.should be_github_oauth_redirect
+ expect(request).to be_github_oauth_redirect
end
end
context 'when logged in' do
before { github_login(scope) }
it 'does nothing' do
- request.should be_ok
+ expect(request).to be_ok
end
end
end
describe '#github_logout' do
context 'when not logged in' do
it 'does nothing' do
- get("/#{type}/logout").body.should eq 'false'
+ expect(get("/#{type}/logout").body).to eq('false')
end
end
context 'when logged in' do
it 'logs out the user' do
github_login(scope)
- get("/#{type}/logout").body.should eq 'true'
- get("/#{type}/logout").body.should eq 'false'
+ expect(get("/#{type}/logout").body).to eq('true')
+ expect(get("/#{type}/logout").body).to eq('false')
end
end
end
describe '#github_authenticated?' do
subject(:request) { get "/#{type}/authenticated" }
context 'when not logged in' do
it 'returns false' do
- request.body.should eq 'false'
+ expect(request.body).to eq('false')
end
end
context 'when logged in' do
it 'returns true' do
github_login(scope)
- request.body.should eq 'true'
+ expect(request.body).to eq('true')
end
end
end
describe '#github_user' do
subject(:request) { get "/#{type}/user" }
context 'when not logged in' do
it 'returns nil' do
- request.body.should be_blank
+ expect(request.body).to be_blank
end
end
context 'when logged in' do
it 'returns the logged in user' do
github_login(scope)
- request.body.
- should include 'Warden::GitHub::Rails::TestHelpers::MockUser'
+ expect(request.body).to \
+ include('Warden::GitHub::Rails::TestHelpers::MockUser')
end
end
end
describe '#github_session' do
subject(:request) { get "/#{type}/session" }
context 'when not logged in' do
it 'should be nil' do
- request.body.should be_blank
+ expect(request.body).to be_blank
end
end
context 'when logged in' do
it "returns the user's session" do
github_login(scope)
- request.body.should == { :foo => :bar }.to_s
+ expect(request.body).to eq({ :foo => :bar }.to_s)
end
end
end
end
end