Skip to content

Instantly share code, notes, and snippets.

@braidn
Created August 9, 2013 13:28
Show Gist options
  • Save braidn/6193581 to your computer and use it in GitHub Desktop.
Save braidn/6193581 to your computer and use it in GitHub Desktop.
require 'spec_helper'
feature "Add child", %q{
as a user
when I log into my account
I can successfully add a kid
} do
let(:user) { Fabricate(:user) }
let(:kid) { Fabricate(:kid) }
before do
login_user
end
scenario 'with correct parameters' do
click_on 'My Children'
fill_in 'child_name', with: kid.name
fill_in 'child_age', with: kid.age
click_on 'Save New Child'
expect(Kid.count).to eq(1)
expect(Kid.last.user_id).to eq(user.id)
expect(current_page).to eq(user_path(user.id))
expect(page).to have_content('Child Successfully Added')
end
end
@braidn
Copy link
Author

braidn commented Aug 9, 2013

John, just the items under scenario block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment