diff --git a/app/helpers/flags_helper.rb b/app/helpers/flags_helper.rb index 715937c0f..b5ba67f41 100644 --- a/app/helpers/flags_helper.rb +++ b/app/helpers/flags_helper.rb @@ -26,4 +26,4 @@ module FlagsHelper end end -end \ No newline at end of file +end diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index b26db7263..501b262e6 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -13,10 +13,12 @@ <%= l investment.created_at.to_date %>  •  <%= investment.heading.name %> -  •  - + + <% if current_user %> +  •  <%= render 'follows/followable_button', followable: investment %> - + <% end %> +
diff --git a/app/views/follows/_followable_button.html.erb b/app/views/follows/_followable_button.html.erb index e54d524c1..94df2c6ad 100644 --- a/app/views/follows/_followable_button.html.erb +++ b/app/views/follows/_followable_button.html.erb @@ -1,37 +1,39 @@ - + + - <% if show_follow_action? followable %> - <%= link_to "##{follow_link_wrapper_id(followable)}", - id: follow_link_wrapper_id(followable), - title: follow_entity_text(followable), - data: { toggle: follow_drop_id(followable) } do %> - <%= t('shared.follow') %> + <% if show_follow_action? followable %> + <%= link_to "##{follow_link_wrapper_id(followable)}", + id: follow_link_wrapper_id(followable), + title: follow_entity_text(followable), + data: { toggle: follow_drop_id(followable) } do %> + <%= t('shared.follow') %> + <% end %> + <% end %> - - <% end %> - <% if show_unfollow_action? followable %> - <% follow = followable.follows.where(user: current_user).first %> - <%= link_to "##{unfollow_link_wrapper_id(followable)}", - id: unfollow_link_wrapper_id(followable), - title: unfollow_entity_text(followable), - data: { toggle: unfollow_drop_id(followable) } do %> - <%= t('shared.unfollow') %> + <% if show_unfollow_action? followable %> + <% follow = followable.follows.where(user: current_user).first %> + <%= link_to "##{unfollow_link_wrapper_id(followable)}", + id: unfollow_link_wrapper_id(followable), + title: unfollow_entity_text(followable), + data: { toggle: unfollow_drop_id(followable) } do %> + <%= t('shared.unfollow') %> + <% end %> + <% end %> - - <% end %> - + + \ No newline at end of file diff --git a/app/views/proposals/_flag_actions.html.erb b/app/views/proposals/_flag_actions.html.erb index aba7a2423..875a23f07 100644 --- a/app/views/proposals/_flag_actions.html.erb +++ b/app/views/proposals/_flag_actions.html.erb @@ -1,19 +1,21 @@ - - <% if show_flag_action? proposal %> - - - - - <% end %> + + + <% if show_flag_action? proposal %> + + + + + <% end %> - <% if show_unflag_action? proposal %> - - - - - <% end %> + <% if show_unflag_action? proposal %> + + + + + <% end %> + diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index c82503f27..00c1cd17e 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -49,14 +49,15 @@  •    <%= link_to t("proposals.show.comments", count: @proposal.comments_count), "#comments" %> -  •  - + + <% if current_user %> +  •  <%= render 'proposals/flag_actions', proposal: @proposal %> - -  •  - + +  •  <%= render 'follows/followable_button', followable: @proposal %> - + <% end %> +
diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 84d8c2611..82700255a 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -329,6 +329,14 @@ feature 'Budget Investments' do end end + scenario "Not sow flaggable buttons" do + investment = create(:budget_investment, heading: heading) + + visit budget_investment_path(budget_id: budget.id, id: investment.id) + + expect(page).not_to have_selector ".js-follow" + end + scenario "Show back link contains heading id" do investment = create(:budget_investment, heading: heading) visit budget_investment_path(budget, investment) diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 3b95feaa5..395d32133 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -61,6 +61,8 @@ feature 'Proposals' do expect(page).to have_content I18n.l(proposal.created_at.to_date) expect(page).to have_selector(avatar(proposal.author.name)) expect(page.html).to include "#{proposal.title}" + expect(page).not_to have_selector ".js-flag-actions" + expect(page).not_to have_selector ".js-follow" within('.social-share-button') do expect(page.all('a').count).to be(4) # Twitter, Facebook, Google+, Telegram