Skip to content

Instantly share code, notes, and snippets.

@ch1ago
Created June 15, 2012 22:49
Show Gist options
  • Save ch1ago/2939096 to your computer and use it in GitHub Desktop.
Save ch1ago/2939096 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe "Session" do
describe "GET /auth/facebook" do
it "with capybara: triggers callback and creates Bob Example" do
Fabricate(:school)
# I'm a guest
visit home_index_path
current_path.should == home_guest_path
-> do
-> do
# - login (creating user)
click_link('login with facebook')
current_path.should == home_user_path
end.should change { User.count }.by(1)
end.should change { Login.count }.by(1)
current_path.should == home_user_path
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment