Sha256: a036c15e499d4a7006606be29a20585e43bf6d3aa67c46cf92b94f09ce26d38e
Contents?: true
Size: 1.08 KB
Versions: 5
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe 'todos app', type: :feature, sauce: true do ENTER_KEY = ENV["BROWSER"] == 'phantom' ? :Enter : :return it 'should add a todo and remove it' do visit '/todos' fill_in 'newtodo', :with => 'Todo 1' find('#newtodo').native.send_keys(ENTER_KEY) expect(page).to have_content('Todo 1') expect(find('#newtodo').value).to eq('') click_button 'X' expect(page).to_not have_content('Todo 1') # Make sure it deleted if ENV['BROWSER'] == 'phantom' visit '/todos' else page.driver.browser.navigate.refresh end expect(page).to_not have_content('Todo 1') end it 'should update a todo check state and persist' do visit '/todos' fill_in 'newtodo', :with => 'Todo 1' find('#newtodo').native.send_keys(ENTER_KEY) expect(page).to have_content('Todo 1') find("input[type='checkbox']").click if ENV['BROWSER'] == 'phantom' visit '/todos' else page.evaluate_script('document.location.reload()') end expect(find("input[type='checkbox']").checked?).to eq(true) end end
Version data entries
5 entries across 5 versions & 1 rubygems