Sha256: 485dc2b3503c7f8e6e837ceff89b9162f64032482daef590ac077e82c34b02ce

Contents?: true

Size: 1.79 KB

Versions: 25

Compression:

Stored size: 1.79 KB

Contents

RSpec.feature 'Accounts', type: :feature do

  context 'editing' do
    scenario 'can edit an admin user' do
      user = create(:admin_user, email: 'admin@person.com', password: 'password', password_confirmation: 'password')
      visit spree.login_path

      fill_in 'Email', with: user.email
      fill_in 'Password', with: user.password
      click_button 'Login'

      click_link 'My Account'
      expect(page).to have_text 'admin@person.com'
    end

    scenario 'can edit a new user' do
      Spree::Auth::Config.set(signout_after_password_change: false)
      visit spree.signup_path

      fill_in 'Email', with: 'email@person.com'
      fill_in 'Password', with: 'password'
      fill_in 'Password Confirmation', with: 'password'
      click_button 'Create'

      click_link 'My Account'
      expect(page).to have_text 'email@person.com'
      click_link 'Edit'

      fill_in 'Password', with: 'foobar'
      fill_in 'Password Confirmation', with: 'foobar'
      click_button 'Update'

      expect(page).to have_text 'email@person.com'
      expect(page).to have_text 'Account updated'
    end

    scenario 'can edit an existing user account' do
      Spree::Auth::Config.set(signout_after_password_change: false)
      user = create(:user, email: 'email@person.com', password: 'secret', password_confirmation: 'secret')
      visit spree.login_path

      fill_in 'Email', with: user.email
      fill_in 'Password', with: user.password
      click_button 'Login'

      click_link 'My Account'
      expect(page).to have_text 'email@person.com'
      click_link 'Edit'

      fill_in 'Password', with: 'foobar'
      fill_in 'Password Confirmation', with: 'foobar'
      click_button 'Update'

      expect(page).to have_text 'email@person.com'
      expect(page).to have_text 'Account updated'
    end
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
solidus_auth_devise-2.2.0 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0.5 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0.4 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0.3 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0.2 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0.1 spec/features/account_spec.rb
solidus_auth_devise_devise_token_auth-2.1.0 spec/features/account_spec.rb
solidus_auth_devise-2.1.0 spec/features/account_spec.rb
solidus_auth_devise-2.0.0 spec/features/account_spec.rb
solidus_auth_devise-1.6.4 spec/features/account_spec.rb
solidus_auth_devise-1.6.3 spec/features/account_spec.rb
solidus_auth_devise-1.6.2 spec/features/account_spec.rb
solidus_auth_devise-1.6.1 spec/features/account_spec.rb
solidus_auth_devise-1.6.0 spec/features/account_spec.rb
solidus_auth_devise-1.5.0 spec/features/account_spec.rb
solidus_auth_devise-1.4.0 spec/features/account_spec.rb
spree_auth_devise-3.0.6 spec/features/account_spec.rb
spree_auth_devise-3.0.5 spec/features/account_spec.rb
solidus_auth_devise-1.3.0 spec/features/account_spec.rb
solidus_auth_devise-1.2.3 spec/features/account_spec.rb