Godwin
7 years ago
15 changed files with 481 additions and 99 deletions
@ -0,0 +1,70 @@ |
|||||
|
= render partial: 'conferences/page_header', locals: {page_key: 'Conference_Survey'} |
||||
|
- if @warnings.present? |
||||
|
= row class: 'warnings', tag: :ul do |
||||
|
- @warnings.each do |warning| |
||||
|
= columns tag: :li, class: 'warning-info' do |
||||
|
= warning |
||||
|
%article |
||||
|
- if !@registration.checked_in? |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%h2=_"articles.conference_survey.headings.post_conference", :t |
||||
|
%p=_"articles.conference_survey.paragraphs.post_conference_not_checked_in", :p |
||||
|
- elsif @registration.survey_taken |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%h2=_"articles.conference_survey.headings.post_conference", :t |
||||
|
%p=_"articles.conference_survey.paragraphs.post_conference_taken", :p |
||||
|
- else |
||||
|
= form_tag conference_survey_save_path(@this_conference.slug) do |
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%h2=_"articles.conference_survey.headings.post_conference", :t |
||||
|
%p=_"articles.conference_survey.paragraphs.post_conference", :p |
||||
|
= textfield :email, nil, required: true, big: true unless logged_in? |
||||
|
%ol.survey |
||||
|
- @this_conference.post_conference_survey_questions.each do |name, question| |
||||
|
%li |
||||
|
%header |
||||
|
%p= _"articles.conference_survey.paragraphs.#{name}", :p |
||||
|
.question-details |
||||
|
- case question[:type] |
||||
|
- when :open_ended |
||||
|
.open-ended= textarea name, nil, plain: true, short: true, label: false, class: question[:comment_size] |
||||
|
- when :multi_likert |
||||
|
- options = question[:options].to_a |
||||
|
- options << question[:waive_option] if question[:waive_option].present? |
||||
|
.table.responsive-table.likert |
||||
|
.table-thead.medium-up |
||||
|
.table-tr |
||||
|
.table-th.corner |
||||
|
- options.each do |option| |
||||
|
.table-th{id: "#{name}-option-#{option}"}=_("articles.conference_survey.likert.#{option}") |
||||
|
.table-tbody |
||||
|
- question[:questions].each do |q| |
||||
|
.table-tr |
||||
|
.table-th{id: "#{name}-question-#{q}"}=_("articles.conference_survey.questions.#{q}") |
||||
|
- options.each do |option| |
||||
|
.table-td |
||||
|
=label_tag do |
||||
|
=radio_button_tag "#{name}_#{q}", option, aria: { labelledby: "#{name}-question-#{q} #{name}-option-#{option}" } |
||||
|
%span.small-only=_("articles.conference_survey.likert.#{option}") |
||||
|
- when :likert |
||||
|
- options = question[:options].to_a |
||||
|
- options << question[:waive_option] if question[:waive_option].present? |
||||
|
- is_numerical = question[:options].is_a?(Range) |
||||
|
%fieldset.likert |
||||
|
- options.each do |option| |
||||
|
= label_tag do |
||||
|
= radio_button_tag name, option |
||||
|
= _("articles.conference_survey.likert.#{option}") |
||||
|
- if question[:comment].present? |
||||
|
.comment |
||||
|
= textarea "#{name}_comment", nil, label: "articles.conference_survey.comment.#{question[:comment] == true ? 'default' : question[:comment]}", plain: true, short: true |
||||
|
|
||||
|
|
||||
|
= row do |
||||
|
= columns(medium: 12) do |
||||
|
%p=_"articles.conference_survey.paragraphs.post_conference_submit", :p |
||||
|
.actions.center |
||||
|
= button :submit |
@ -0,0 +1,44 @@ |
|||||
|
Feature: Survey |
||||
|
|
||||
|
Scenario: Take the post-conference survey |
||||
|
Given that there is a past conference |
||||
|
And registration is closed |
||||
|
And I am logged in |
||||
|
And registered |
||||
|
And I am checked in |
||||
|
And I am on the registration page |
||||
|
Then I should see 'Please share your feelings and experiences' |
||||
|
|
||||
|
When I click on 'Take the survey now' |
||||
|
Then I should see 'Please share your feelings and experiences from this year's Bike!Bike!' |
||||
|
But I should not see 'Thank you for taking the post-conference survey' |
||||
|
|
||||
|
When I click on 'This was my first time attending' |
||||
|
And click on 'Likely' |
||||
|
And set housing to satisfied under services |
||||
|
And set bike to NA under services |
||||
|
And set food to unsatisfied under services |
||||
|
And set schedule to neutral under services |
||||
|
And set events to very satisfied under services |
||||
|
And set website to very unsatisfied under services |
||||
|
And enter a services comment as 'The website sucks' |
||||
|
And enter an experience as 'Fun' |
||||
|
And enter improvement ideas as 'No idea' |
||||
|
And click 'Submit' |
||||
|
|
||||
|
Then I should see 'Thank you for taking the post-conference survey' |
||||
|
|
||||
|
Scenario: Try to take the post-conference survey when not checked in |
||||
|
Given that there is a past conference |
||||
|
And registration is closed |
||||
|
And I am logged in |
||||
|
And registered |
||||
|
And I am not checked in |
||||
|
And I am on the conference survey page |
||||
|
|
||||
|
Then I should see 'you did not check in' |
||||
|
Then I should not see 'Please share your feelings and experiences from this year's Bike!Bike!' |
||||
|
But I should not see 'Thank you for taking the post-conference survey' |
||||
|
|
||||
|
When I go to the registration page |
||||
|
Then I should not see 'Please share your feelings and experiences' |
Loading…
Reference in new issue