Files
nairobi/spec/features/account_spec.rb
Juanjo Bazán 8f6e5ecfc8 adds basic 'my account' page
Fields related with authentication are not included
because the auth system will change to integrate with 
Madrid.es's Ciudadano360
ref: #22
2015-07-30 17:36:32 +02:00

33 lines
734 B
Ruby

require 'rails_helper'
feature 'Account' do
background do
@user = create(:user, first_name: "Manuela", last_name:"Colau")
end
scenario 'Show' do
login_as(@user)
visit root_path
click_link "My account"
expect(page).to have_selector("input[value='Manuela']")
expect(page).to have_selector("input[value='Colau']")
end
scenario 'Edit' do
login_as(@user)
visit account_path
fill_in 'account_first_name', with: 'Larry'
fill_in 'account_last_name', with: 'Bird'
click_button 'Save changes'
expect(page).to have_content "Saved"
visit account_path
expect(page).to have_selector("input[value='Larry']")
expect(page).to have_selector("input[value='Bird']")
end
end