Stub out Regimen and RegimenItem class
parent
9f003f5822
commit
af6733fdd5
|
@ -1,23 +1,23 @@
|
|||
require 'spec_helper'
|
||||
|
||||
xdescribe 'User Registration' do
|
||||
it 'creates a new user account' do
|
||||
visit root_path
|
||||
fill_in 'user_name', with: 'ricky_ricardo'
|
||||
fill_in 'user_password', with: 'password123'
|
||||
fill_in 'user_email', with: 'test@test.com'
|
||||
fill_in 'user_password_confirmation', with: 'password123'
|
||||
click_button 'Sign Up'
|
||||
expect(page).to have_content 'Welcome! You have signed up successfully.'
|
||||
expect(User.find_by(email: 'test@test.com')).to be
|
||||
end
|
||||
# xdescribe 'User Registration' do
|
||||
# it 'creates a new user account' do
|
||||
# visit root_path
|
||||
# fill_in 'user_name', with: 'ricky_ricardo'
|
||||
# fill_in 'user_password', with: 'password123'
|
||||
# fill_in 'user_email', with: 'test@test.com'
|
||||
# fill_in 'user_password_confirmation', with: 'password123'
|
||||
# click_button 'Sign Up'
|
||||
# expect(page).to have_content 'Welcome! You have signed up successfully.'
|
||||
# expect(User.find_by(email: 'test@test.com')).to be
|
||||
# end
|
||||
|
||||
it 'requires a user name' do
|
||||
visit root_path
|
||||
fill_in 'user_password', with: 'password123'
|
||||
fill_in 'user_email', with: 'test@test.com'
|
||||
fill_in 'user_password_confirmation', with: 'password123'
|
||||
click_button 'Sign Up'
|
||||
expect(page).to have_content "Name can't be blank"
|
||||
end
|
||||
end
|
||||
# it 'requires a user name' do
|
||||
# visit root_path
|
||||
# fill_in 'user_password', with: 'password123'
|
||||
# fill_in 'user_email', with: 'test@test.com'
|
||||
# fill_in 'user_password_confirmation', with: 'password123'
|
||||
# click_button 'Sign Up'
|
||||
# expect(page).to have_content "Name can't be blank"
|
||||
# end
|
||||
# end
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
require 'spec_helper'
|
||||
|
||||
xdescribe 'User Session' do
|
||||
it 'logs the user in' do
|
||||
user = FactoryGirl.create(:user)
|
||||
visit new_user_session_path
|
||||
fill_in 'user_email', with: user.email
|
||||
fill_in 'user_password', with: user.password
|
||||
click_button 'Sign in'
|
||||
expect(page).to have_content('Signed in successfully.')
|
||||
end
|
||||
# xdescribe 'User Session' do
|
||||
# it 'logs the user in' do
|
||||
# user = FactoryGirl.create(:user)
|
||||
# visit new_user_session_path
|
||||
# fill_in 'user_email', with: user.email
|
||||
# fill_in 'user_password', with: user.password
|
||||
# click_button 'Sign in'
|
||||
# expect(page).to have_content('Signed in successfully.')
|
||||
# end
|
||||
|
||||
it 'edits user settings', js: true do
|
||||
user = FactoryGirl.create(:user)
|
||||
sign_in_as user
|
||||
visit edit_user_registration_path
|
||||
old_email = user.email
|
||||
new_email = Faker::Internet.email
|
||||
fill_in 'user_email', with: new_email
|
||||
fill_in 'user_current_password', with: user.password
|
||||
click_button 'Update'
|
||||
expect(page).to have_content('Your account has been updated successfully.')
|
||||
expect(user.reload.email).to eq(new_email)
|
||||
end
|
||||
# it 'edits user settings', js: true do
|
||||
# user = FactoryGirl.create(:user)
|
||||
# sign_in_as user
|
||||
# visit edit_user_registration_path
|
||||
# old_email = user.email
|
||||
# new_email = Faker::Internet.email
|
||||
# fill_in 'user_email', with: new_email
|
||||
# fill_in 'user_current_password', with: user.password
|
||||
# click_button 'Update'
|
||||
# expect(page).to have_content('Your account has been updated successfully.')
|
||||
# expect(user.reload.email).to eq(new_email)
|
||||
# end
|
||||
|
||||
it 'logs the user out' do
|
||||
user = FactoryGirl.create(:user)
|
||||
sign_in_as(user)
|
||||
click_link 'Sign out'
|
||||
expect(page).to have_content('Signed out successfully.')
|
||||
end
|
||||
end
|
||||
# it 'logs the user out' do
|
||||
# user = FactoryGirl.create(:user)
|
||||
# sign_in_as(user)
|
||||
# click_link 'Sign out'
|
||||
# expect(page).to have_content('Signed out successfully.')
|
||||
# end
|
||||
# end
|
||||
|
|
Loading…
Reference in New Issue