Skip to content

Instantly share code, notes, and snippets.

@nfriend21
Created December 19, 2012 22:06
Show Gist options
  • Save nfriend21/4340983 to your computer and use it in GitHub Desktop.
Save nfriend21/4340983 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe 'Member Signup Page' do
it 'loads the signup form' do
visit '/members/new'
page.should have_content('Signup')
end
it "creates a new member in the database" do
visit '/members/new'
fill_in "Name", :with => "Nick1 Friend"
fill_in "Email", :with => "[email protected]"
fill_in "Username", :with => "nfriend21"
fill_in "Password", :with => "larrys"
fill_in "Password confirmation", :with => "larrys"
click_button "Submit"
member = Member.last
puts member.name
visit '/members/new'
fill_in "Name", :with => "Nick2 Friend"
fill_in "Email", :with => "[email protected]"
fill_in "Username", :with => "nfriend22"
fill_in "Password", :with => "larrys"
fill_in "Password confirmation", :with => "larrys"
click_button "Submit"
new_member = Member.last
new_member.id.should_not == member.id
page.should have_content('Your account has been created')
end
end
describe 'Member Login Page' do
it "logs in an existing user" do
visit '/login'
fill_in "Username", :with => "nfriend22"
fill_in "Password", :with => "larrys"
click_button "Log In"
page.should have_content('Friend')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment