spec/features/clone_spec.rb in fae-rails-1.2.5 vs spec/features/clone_spec.rb in fae-rails-1.3.0
- old
+ new
@@ -54,12 +54,13 @@
expect(cloned_release.aromas.first).to_not eq(release.aromas.first)
expect(cloned_release.aromas.first.name).to eq(release.aromas.first.name)
# habtm duplicates the join records
expect(cloned_release.events).to eq(release.events)
- expect(page.find('.release_events')).to have_content(event_1.name)
- expect(page.find('.release_events')).to have_content(event_2.name)
+ # Case insensitive matching in case labels become text-transform: uppercase
+ expect(page).to have_selector('.release_events', text: /#{event_1.name}/i)
+ expect(page).to have_selector('.release_events', text: /#{event_2.name}/i)
}
end
end
@@ -67,11 +68,11 @@
scenario 'should duplicate the record and redirect to edit form', js: true do
release = FactoryGirl.create(:release, name: 'Ima Release', vintage: '2012', price: 13, varietal_id: 2, show: Date.today)
admin_login
visit admin_releases_path
- page.find('.main_table-clone').click
+ page.find('a.table-action[title="Clone"]').click
# support/async_helper.rb
eventually {
cloned_release = Release.find_by_name('Ima Release-2')
expect(cloned_release).to_not be_nil
@@ -82,10 +83,10 @@
scenario 'should set on_prod when true to false' do
release = FactoryGirl.create(:release, name: 'Ima Release', vintage: '2012', on_prod: true, price: 13, varietal_id: 2, show: Date.today)
admin_login
visit admin_releases_path
- page.find('.main_table-clone').click
+ page.find('a.table-action[title="Clone"]').click
eventually {
expect(find_field('release_on_prod_false').value).to eq('false')
}