Sha256: cdbae277a73fb0e12edaa76a75950f3c0e343e8ff39c32af807438fb72a59db3

Contents?: true

Size: 1.22 KB

Versions: 12

Compression:

Stored size: 1.22 KB

Contents

RSpec.feature 'Users' do
  background do
    rom.relations.users.insert(name: 'Jane')
    rom.relations.users.insert(name: 'Joe')
  end

  scenario 'I see user list on index page' do
    visit '/users'

    expect(page).to have_content('Jane')
    expect(page).to have_content('Joe')
  end

  scenario 'I save a new user' do
    visit '/users/new'

    click_on 'Create User'
    expect(page).to have_content("can't be blank")

    find('#user_email').set('jade@doe.org')
    find('#user_name').set('Jade')
    click_on 'Create User'

    expect(page).to have_content('Jade')
    expect(page).to have_content('Jane')
    expect(page).to have_content('Joe')
  end

  scenario 'I edit an existing user' do
    jane = rom.relations.users.by_name('Jane').first
    visit "/users/#{jane[:id]}/edit"

    click_on 'Update User'
    expect(page).to have_content("can't be blank")

    find('#user_email').set('jane.doe@example.org')
    find('#user_name').set('Jane Doe')
    click_on 'Update User'

    expect(page).to have_content('Jane Doe')
    expect(page).to have_content('Joe')
  end

  scenario 'I can search users' do
    visit '/users/search?name=Jane'

    expect(page).to have_content('Jane')
    expect(page).to_not have_content('Joe')
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-rails-2.4.0 spec/features/users_spec.rb
rom-rails-2.3.1 spec/features/users_spec.rb
rom-rails-2.3.0 spec/features/users_spec.rb
rom-rails-2.2.0 spec/features/users_spec.rb
rom-rails-2.0.0 spec/features/users_spec.rb
rom-rails-1.2.0 spec/features/users_spec.rb
rom-rails-1.1.1 spec/features/users_spec.rb
rom-rails-1.1.0 spec/features/users_spec.rb
rom-rails-1.0.1 spec/features/users_spec.rb
rom-rails-1.0.0 spec/features/users_spec.rb
rom-rails-1.0.0.rc1 spec/features/users_spec.rb
rom-rails-1.0.0.beta1 spec/features/users_spec.rb