diff options
author | ThibG <thib@sitedethib.com> | 2019-01-20 13:56:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-20 13:56:37 +0100 |
commit | aa362ab73dc7121104b3c01800152b9fc56ea396 (patch) | |
tree | f0f5879a51325856887a2e32a4c3f9654af61aab /spec | |
parent | 530d29148ca0c5bf29f6fa516b1ef4f91d95894b (diff) | |
parent | 5145c81620efbd5cf8dc911858d17d1fa888c996 (diff) |
Merge pull request #888 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/tags_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/unfollow_service_spec.rb | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index 33ccaed61..69def90cf 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -17,7 +17,7 @@ RSpec.describe TagsController, type: :controller do it 'renders application layout' do get :show, params: { id: 'test', max_id: late.id } - expect(response).to render_template layout: 'application' + expect(response).to render_template layout: 'public' end end diff --git a/spec/services/unfollow_service_spec.rb b/spec/services/unfollow_service_spec.rb index c5914c818..8a2881ab1 100644 --- a/spec/services/unfollow_service_spec.rb +++ b/spec/services/unfollow_service_spec.rb @@ -56,4 +56,22 @@ RSpec.describe UnfollowService, type: :service do expect(a_request(:post, 'http://example.com/inbox')).to have_been_made.once end end + + describe 'remote ActivityPub (reverse)' do + let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox')).account } + + before do + bob.follow!(sender) + stub_request(:post, 'http://example.com/inbox').to_return(status: 200) + subject.call(bob, sender) + end + + it 'destroys the following relation' do + expect(bob.following?(sender)).to be false + end + + it 'sends a reject activity' do + expect(a_request(:post, 'http://example.com/inbox')).to have_been_made.once + end + end end |