From 3daa12f83fdbc9a44ea6c14d7843501262478721 Mon Sep 17 00:00:00 2001 From: shlok007 Date: Wed, 28 Jun 2017 08:05:04 +0530 Subject: [PATCH] fix tests for cfps after rebase --- spec/features/ability_spec.rb | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/spec/features/ability_spec.rb b/spec/features/ability_spec.rb index 41775de4..915ce401 100644 --- a/spec/features/ability_spec.rb +++ b/spec/features/ability_spec.rb @@ -114,12 +114,12 @@ feature 'Has correct abilities' do visit new_admin_conference_program_cfp_path(conference1.short_title) expect(current_path).to eq root_path - + conference1.program.cfp.destroy! visit new_admin_conference_program_cfp_path(conference1.short_title) expect(current_path).to eq new_admin_conference_program_cfp_path(conference1.short_title) create(:cfp, program: conference1.program) - + visit edit_admin_conference_program_cfp_path(conference1.short_title, conference1.program.cfp) expect(current_path).to eq(edit_admin_conference_program_cfp_path(conference1.short_title, conference1.program.cfp)) @@ -484,13 +484,15 @@ feature 'Has correct abilities' do expect(current_path).to eq(edit_admin_conference_program_path(conference2.short_title)) visit new_admin_conference_program_cfp_path(conference2.short_title) - expect(current_path).to eq(new_admin_conference_program_cfp_path(conference2.short_title)) + expect(current_path).to eq root_path - visit edit_admin_conference_program_cfp_path(conference2.short_title) - expect(current_path).to eq(edit_admin_conference_program_cfp_path(conference2.short_title)) + conference2.program.cfp.destroy! + visit new_admin_conference_program_cfp_path(conference2.short_title) + expect(current_path).to eq new_admin_conference_program_cfp_path(conference2.short_title) + create(:cfp, program: conference2.program) - visit admin_conference_program_events_path(conference2.short_title) - expect(current_path).to eq(admin_conference_program_events_path(conference2.short_title)) + visit edit_admin_conference_program_cfp_path(conference2.short_title, conference2.program.cfp) + expect(current_path).to eq(edit_admin_conference_program_cfp_path(conference2.short_title, conference2.program.cfp)) create(:event, program: conference2.program) visit edit_admin_conference_program_event_path(conference2.short_title, conference2.program.events.first) @@ -592,9 +594,14 @@ feature 'Has correct abilities' do expect(current_path).to eq(root_path) visit new_admin_conference_program_cfp_path(conference3.short_title) - expect(current_path).to eq(root_path) + expect(current_path).to eq root_path - visit edit_admin_conference_program_cfp_path(conference3.short_title) + conference1.program.cfp.destroy! + visit new_admin_conference_program_cfp_path(conference3.short_title) + expect(current_path).to eq root_path + create(:cfp, program: conference1.program) + + visit edit_admin_conference_program_cfp_path(conference3.short_title, conference3.program.cfp) expect(current_path).to eq(root_path) visit admin_conference_program_events_path(conference3.short_title)