Merge some contributor fixes

This commit is contained in:
Michael Ball 2020-06-30 00:48:47 -07:00
commit 0877aadb2e
72 changed files with 225 additions and 206 deletions

View file

@ -75,7 +75,7 @@ feature Commercial do
expect(page).to have_css("button[type='submit']:disabled", text: 'Save Materials')
end
scenario 'updates a commercial of an event', feature: true, js: true do
scenario 'updates materials of an event', feature: true, js: true do
commercial = create(:commercial,
commercialable_id: event.id,
commercialable_type: 'Event')
@ -85,7 +85,6 @@ feature Commercial do
click_button 'Update'
page.find('#flash')
expect(flash).to eq('Materials were successfully updated.')
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
expect(event.commercials.count).to eq(1)
commercial.reload
expect(commercial.url).to eq('https://www.youtube.com/watch?v=M9bq_alk-sw')
@ -117,8 +116,7 @@ feature Commercial do
click_link 'Delete'
end
page.find('#flash')
expect(flash).to eq('Materials were successfully destroyed.')
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
expect(flash).to eq('Materials successfully destroyed.')
expect(event.commercials.count).to eq(0)
end
end

View file

@ -114,9 +114,12 @@ feature Event do
visit conference_program_proposals_path(conference.short_title)
click_link 'New Proposal'
expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation
fill_in 'event_title', with: 'Example Proposal'
select('Example Event Type', from: 'event[event_type_id]')
expect(page).to have_selector(".in[id='#{find_field('event[event_type_id]').value}-help']") # End of animation
fill_in 'event_abstract', with: 'Lorem ipsum abstract'
expect(page).to have_text('You have used 3 words')
@ -127,7 +130,6 @@ feature Event do
page.find('#flash')
expect(page).to have_content 'Proposal was successfully submitted.'
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
expect(current_path).to eq(conference_program_proposals_path(conference.short_title))
expect(Event.count).to eq(expected_count)
end

View file

@ -318,17 +318,14 @@ feature 'Version' do
end
context 'organization role', feature: true, versioning: true, js: true do
let!(:organization_admin) { create(:organization_admin, organization: conference.organization) }
let!(:user) { create(:user) }
let!(:role) do
Role.find_by(
resource_id: conference.organization.id,
resource_type: 'Organization'
)
end
setup do
user.add_role :organization_admin, conference.organization
user.remove_role :organization_admin, conference.organization
sign_in organization_admin
visit admin_revision_history_path
end
@ -392,7 +389,7 @@ feature 'Version' do
click_link 'Comments (0)'
fill_in 'comment_body', with: 'Sample comment'
click_button 'Add Comment'
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
expect(page).to have_text('Comments (1)')
Comment.last.destroy
PaperTrail::Version.last.reify.save