diff --git a/app/controllers/guidance_groups_controller.rb b/app/controllers/guidance_groups_controller.rb index 11b214b..e12c18c 100644 --- a/app/controllers/guidance_groups_controller.rb +++ b/app/controllers/guidance_groups_controller.rb @@ -29,7 +29,7 @@ if @guidance_group.save redirect_to admin_index_guidance_path, notice: success_message(_('guidance group'), _('created')) else - flash[:notice] = failed_create_error(@guidance_group, _('guidance group')) + flash[:alert] = failed_create_error(@guidance_group, _('guidance group')) render 'admin_new' end end diff --git a/test/functional/guidance_groups_controller_test.rb b/test/functional/guidance_groups_controller_test.rb index f4d55ff..1579400 100644 --- a/test/functional/guidance_groups_controller_test.rb +++ b/test/functional/guidance_groups_controller_test.rb @@ -65,7 +65,7 @@ # Invalid object post admin_create_guidance_group_path(@user.org), {guidance_group: {name: nil}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].start_with?(_('Could not create your')) assert_response :success assert assigns(:guidance_group) end @@ -103,7 +103,7 @@ # Invalid object put admin_update_guidance_group_path(GuidanceGroup.first), {guidance_group: {name: nil}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:guidance_group) end diff --git a/test/functional/guidances_controller_test.rb b/test/functional/guidances_controller_test.rb index a7f7696..e16670d 100644 --- a/test/functional/guidances_controller_test.rb +++ b/test/functional/guidances_controller_test.rb @@ -102,7 +102,7 @@ # Invalid object post admin_create_guidance_path(@user.org), {'guidance-text': nil, guidance: {published: false}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].starts_with?(_('Could not create your')) assert_response :success assert assigns(:guidance) end @@ -127,7 +127,7 @@ # Invalid object put admin_update_guidance_path(Guidance.first), {'guidance-text': nil, guidance: {guidance_group_id: GuidanceGroup.first.id}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:guidance) end diff --git a/test/functional/phases_controller_test.rb b/test/functional/phases_controller_test.rb index 5b26435..3a5d1d7 100644 --- a/test/functional/phases_controller_test.rb +++ b/test/functional/phases_controller_test.rb @@ -164,7 +164,7 @@ # Invalid object post admin_create_phase_path(@template.phases.first), {phase: {template_id: @template.id}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].starts_with?(_('Could not create your')) assert_response :success assert assigns(:phase) assert assigns(:template) @@ -197,7 +197,7 @@ # Invalid save put admin_update_phase_path(@template.phases.first), {phase: {title: nil}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:phase) assert assigns(:template) diff --git a/test/functional/questions_controller_test.rb b/test/functional/questions_controller_test.rb index 61007c4..297df79 100644 --- a/test/functional/questions_controller_test.rb +++ b/test/functional/questions_controller_test.rb @@ -65,7 +65,7 @@ # Invalid object post admin_create_question_path(@section), {question: {section_id: @section.id, text: nil, question_format_id: @question_format.id}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].starts_with?(_('Could not create your')) assert_response :success assert assigns(:question) assert assigns(:section) @@ -105,7 +105,7 @@ # Invalid save put admin_update_question_path(@section.questions.first), {question: {text: nil}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:question) assert assigns(:section) diff --git a/test/functional/registrations_controller_test.rb b/test/functional/registrations_controller_test.rb index b5c7126..97acfe4 100644 --- a/test/functional/registrations_controller_test.rb +++ b/test/functional/registrations_controller_test.rb @@ -92,7 +92,7 @@ # Change email but didn't provide password put user_registration_path, {user: {email: 'something@else.org', firstname: @user.firstname, surname: @user.surname, org_id: Org.first.id}} assert_response :success - assert_equal _('Please enter your password to change email address.'), flash[:notice] + assert_equal _('Please enter your password to change email address.'), flash[:alert] # TODO: These don't seem to be behaving as expected. There were several typos in the controller that have been fixed # (succesfully_updated vs successfully_updated) diff --git a/test/functional/sections_controller_test.rb b/test/functional/sections_controller_test.rb index 0c8e1e1..0166d45 100644 --- a/test/functional/sections_controller_test.rb +++ b/test/functional/sections_controller_test.rb @@ -59,7 +59,7 @@ # Invalid object post admin_create_section_path(@phase), {section: {phase_id: @phase.id, title: nil}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].starts_with?(_('Could not create your')) assert_response :success assert assigns(:section) assert assigns(:phase) @@ -94,7 +94,7 @@ # Invalid save put admin_update_section_path(@phase.sections.first), {section: {title: nil}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:section) assert assigns(:phase) diff --git a/test/functional/templates_controller_test.rb b/test/functional/templates_controller_test.rb index 048f679..6a14369 100644 --- a/test/functional/templates_controller_test.rb +++ b/test/functional/templates_controller_test.rb @@ -121,7 +121,7 @@ # Try to delete a historical version should fail delete admin_destroy_template_path(prior) - assert_equal _('You cannot delete historical versions of this template.'), flash[:notice] + assert_equal _('You cannot delete historical versions of this template.'), flash[:alert] assert_response :redirect assert_redirected_to admin_index_template_path assert_not Template.find(prior.id).nil? @@ -157,7 +157,7 @@ # Invalid object post admin_create_template_path(@user.org), {template: {title: nil, org_id: @user.org.id}} - assert flash[:notice].starts_with?(_('Could not create your')) + assert flash[:alert].starts_with?(_('Could not create your')) assert_response :success assert assigns(:template) assert assigns(:hash) @@ -201,7 +201,7 @@ # Make sure we get the right response when providing an invalid template put admin_update_template_path(current), {template: {title: nil}} - assert flash[:notice].starts_with?(_('Could not update your')) + assert flash[:alert].starts_with?(_('Could not update your')) assert_response :success assert assigns(:template) assert assigns(:hash) @@ -270,7 +270,7 @@ # We shouldn't be able to edit a historical version put admin_publish_template_path(prior) - assert_equal _('You can not publish a historical version of this template.'), flash[:notice] + assert_equal _('You can not publish a historical version of this template.'), flash[:alert] assert_response :redirect assert_redirected_to admin_template_template_url(prior) assert assigns(:template)