Refactored proposal. Enabled cancancan

This commit is contained in:
Henne Vogelsang 2014-07-23 16:24:05 +02:00
parent 0ae7991943
commit c982cbb88a
13 changed files with 204 additions and 231 deletions

View file

@ -11,7 +11,7 @@ feature Event do
feature: true, js: true do
admin = create(:admin, email: 'admin@example.com')
participant = create(:participant, email: 'participant@example.com')
participant = create(:participant, email: 'participant@example.com', biography: "")
expected_count = Event.count + 1
conference = create(:conference)
@ -37,9 +37,8 @@ feature Event do
fill_in 'event_media_id', with: '123456'
fill_in 'user_biography', with: 'Lorem ipsum biography'
fill_in 'user_name', with: 'Example User'
click_button 'Submit Session'
click_button 'Create Event'
expect(current_path).to eq(register_conference_path(conference.short_title))
expect(Event.count).to eq(expected_count)
@ -77,7 +76,7 @@ feature Event do
expect(page.has_content?('Unconfirmed')).to be true
click_link "confirm_proposal_#{event.id}"
expect(flash).
to eq('Event was confirmed. Please register to attend the conference.')
to eq('The proposal was confirmed. Please register to attend the conference.')
# Register for conference
find('#register').click
@ -87,7 +86,7 @@ feature Event do
visit conference_proposal_index_path(conference.short_title)
expect(page.has_content?('Confirmed')).to be true
click_link "delete_proposal_#{event.id}"
expect(flash).to eq('Proposal withdrawn.')
expect(flash).to eq('Proposal was successfully withdrawn.')
end
end