From 86f0cae7bbdd78141f0cd8d3bb7f34b60c9d7c41 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 6 Jun 2016 13:52:40 +0200 Subject: [PATCH] fixes specs --- app/views/proposals/_notifications.html.erb | 14 ++++++++------ spec/features/proposal_notifications_spec.rb | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/proposals/_notifications.html.erb b/app/views/proposals/_notifications.html.erb index 576ed8cc6..9e3af3e9e 100644 --- a/app/views/proposals/_notifications.html.erb +++ b/app/views/proposals/_notifications.html.erb @@ -1,6 +1,8 @@ -
- <% @notifications.each do |notification| %> -
<%= notification.title %>
-
<%= notification.body %>
- <% end %> -
\ No newline at end of file +<% if @notifications.present? %> +
+ <% @notifications.each do |notification| %> +
<%= notification.title %>
+
<%= notification.body %>
+ <% end %> +
+<% end %> \ No newline at end of file diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index 1662475b1..3046c6ab5 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -17,7 +17,7 @@ feature 'Proposal Notifications' do fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal" fill_in 'proposal_notification_body', with: "Please share it with others so we can make it happen!" - click_button "Send" + click_button "Send message" expect(page).to have_content "Your message has been sent correctly." expect(page).to have_content "Thank you for supporting my proposal" @@ -66,7 +66,7 @@ feature 'Proposal Notifications' do proposal = create(:proposal) visit new_proposal_notification_path(proposal_id: proposal.id) - click_button "Send" + click_button "Send message" expect(page).to have_content error_message end