Sha256: 2208ed2163d1f369c4ba4c6af5b346e8c75a83522722315e06fbca9c6647d786

Contents?: true

Size: 1.24 KB

Versions: 17

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

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

17 entries across 17 versions & 1 rubygems

Version Path
rom-rails-0.9.0 spec/features/users_spec.rb
rom-rails-0.9.0.beta1 spec/features/users_spec.rb
rom-rails-0.8.0 spec/features/users_spec.rb
rom-rails-0.7.0 spec/features/users_spec.rb
rom-rails-0.6.0 spec/features/users_spec.rb
rom-rails-0.6.0.rc1 spec/features/users_spec.rb
rom-rails-0.6.0.beta1 spec/features/users_spec.rb
rom-rails-0.5.0 spec/features/users_spec.rb
rom-rails-0.5.0.rc1 spec/features/users_spec.rb
rom-rails-0.5.0.beta1 spec/features/users_spec.rb
rom-rails-0.4.0 spec/features/users_spec.rb
rom-rails-0.3.3 spec/dummy/spec/features/users_spec.rb
rom-rails-0.3.2 spec/dummy/spec/features/users_spec.rb
rom-rails-0.3.1 spec/dummy/spec/features/users_spec.rb
rom-rails-0.3.0 spec/dummy/spec/features/users_spec.rb
rom-rails-0.3.0.rc1 spec/dummy/spec/features/users_spec.rb
rom-rails-0.3.0.beta1 spec/dummy/spec/features/users_spec.rb