[deploy] Use bulk_show Endpoint for Follow Buttons on Followers Dashboard (#7849)
This commit is contained in:
parent
5b4ef24468
commit
d2fbad08d4
2 changed files with 26 additions and 1 deletions
|
|
@ -31,7 +31,7 @@
|
|||
<span class="dashboard-username">@<%= user.username %></span>
|
||||
<a href="#"
|
||||
id="dashboard-follow"
|
||||
class="cta follow-action-button dashboard-follow"
|
||||
class="cta follow-action-button dashboard-follow follow-user"
|
||||
data-info='{"id":<%= user.id %>,"className":"<%= user.class.name %>","style":"follow-back"}'>
|
||||
|
||||
</a>
|
||||
|
|
|
|||
25
spec/system/dashboards/user_followers_display_spec.rb
Normal file
25
spec/system/dashboards/user_followers_display_spec.rb
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe "Followers Dashboard", type: :system, js: true do
|
||||
let(:default_per_page) { 3 }
|
||||
let(:user) { create(:user) }
|
||||
let(:followed_user) { create(:user) }
|
||||
let(:following_user) { create(:user) }
|
||||
|
||||
before do
|
||||
sign_in user
|
||||
end
|
||||
|
||||
context "when /dashboard/user_followers is visited" do
|
||||
it "displays correct following buttons" do
|
||||
stub_request(:post, "http://www.google-analytics.com/collect")
|
||||
following_user.follow(user)
|
||||
followed_user.follow(user)
|
||||
user.follow(followed_user)
|
||||
visit "/dashboard/user_followers"
|
||||
|
||||
expect(JSON.parse(find_link("✓ FOLLOWING")["data-info"])["id"]).to eq(followed_user.id)
|
||||
expect(JSON.parse(find_link("+ FOLLOW BACK")["data-info"])["id"]).to eq(following_user.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue