about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-05-09 09:40:09 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:23 -0500
commite85b8af05183d1048adc4a39bc3d975af153463d (patch)
tree0cda58965ce9c8104cd65a6761678f2154bacd08 /spec/controllers
parent66886d4367b64d6860c55ab6f8a57a31ed9b59de (diff)
Second round of Rspec fixes.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin/accounts_controller_spec.rb38
-rw-r--r--spec/controllers/api/v1/follows_controller_spec.rb8
-rw-r--r--spec/controllers/concerns/account_controller_concern_spec.rb2
-rw-r--r--spec/controllers/relationships_controller_spec.rb4
-rw-r--r--spec/controllers/remote_unfollows_controller_spec.rb2
5 files changed, 4 insertions, 50 deletions
diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb
index a348ab3d7..608606ff9 100644
--- a/spec/controllers/admin/accounts_controller_spec.rb
+++ b/spec/controllers/admin/accounts_controller_spec.rb
@@ -75,44 +75,6 @@ RSpec.describe Admin::AccountsController, type: :controller do
     end
   end
 
-  describe 'POST #subscribe' do
-    subject { post :subscribe, params: { id: account.id } }
-
-    let(:current_user) { Fabricate(:user, admin: admin) }
-    let(:account) { Fabricate(:account) }
-
-    context 'when user is admin' do
-      let(:admin) { true }
-
-      it { is_expected.to redirect_to admin_account_path(account.id) }
-    end
-
-    context 'when user is not admin' do
-      let(:admin) { false }
-
-      it { is_expected.to have_http_status :forbidden }
-    end
-  end
-
-  describe 'POST #unsubscribe' do
-    subject { post :unsubscribe, params: { id: account.id } }
-
-    let(:current_user) { Fabricate(:user, admin: admin) }
-    let(:account) { Fabricate(:account) }
-
-    context 'when user is admin' do
-      let(:admin) { true }
-
-      it { is_expected.to redirect_to admin_account_path(account.id) }
-    end
-
-    context 'when user is not admin' do
-      let(:admin) { false }
-
-      it { is_expected.to have_http_status :forbidden }
-    end
-  end
-
   describe 'POST #memorialize' do
     subject { post :memorialize, params: { id: account.id } }
 
diff --git a/spec/controllers/api/v1/follows_controller_spec.rb b/spec/controllers/api/v1/follows_controller_spec.rb
index 089e0fe5e..df335cc5d 100644
--- a/spec/controllers/api/v1/follows_controller_spec.rb
+++ b/spec/controllers/api/v1/follows_controller_spec.rb
@@ -35,14 +35,6 @@ RSpec.describe Api::V1::FollowsController, type: :controller do
       expect(user.account.following?(Account.find_by(username: 'gargron', domain: 'quitter.no'))).to be true
     end
 
-    it 'sends a salmon slap to the remote user' do
-      expect(a_request(:post, "https://quitter.no/main/salmon/user/7477")).to have_been_made
-    end
-
-    it 'subscribes to remote hub' do
-      expect(a_request(:post, "https://quitter.no/main/push/hub")).to have_been_made
-    end
-
     it 'returns http success if already following, too' do
       post :create, params: { uri: 'gargron@quitter.no' }
       expect(response).to have_http_status(200)
diff --git a/spec/controllers/concerns/account_controller_concern_spec.rb b/spec/controllers/concerns/account_controller_concern_spec.rb
index ea2b4a2a1..6c58ca559 100644
--- a/spec/controllers/concerns/account_controller_concern_spec.rb
+++ b/spec/controllers/concerns/account_controller_concern_spec.rb
@@ -41,7 +41,7 @@ describe ApplicationController, type: :controller do
     it 'sets link headers' do
       account = Fabricate(:account, username: 'username', user: Fabricate(:user))
       get 'success', params: { account_username: 'username' }
-      expect(response.headers['Link'].to_s).to eq '<http://test.host/.well-known/webfinger?resource=acct%3Ausername%40cb6e6126.ngrok.io>; rel="lrdd"; type="application/xrd+xml", <http://test.host/users/username.atom>; rel="alternate"; type="application/atom+xml", <https://cb6e6126.ngrok.io/users/username>; rel="alternate"; type="application/activity+json"'
+      expect(response.headers['Link'].to_s).to eq '<http://test.host/.well-known/webfinger?resource=acct%3Ausername%40cb6e6126.ngrok.io>; rel="lrdd"; type="application/xrd+xml", <https://cb6e6126.ngrok.io/users/username>; rel="alternate"; type="application/activity+json"'
     end
 
     it 'returns http success' do
diff --git a/spec/controllers/relationships_controller_spec.rb b/spec/controllers/relationships_controller_spec.rb
index 16e255afe..ea667a3f2 100644
--- a/spec/controllers/relationships_controller_spec.rb
+++ b/spec/controllers/relationships_controller_spec.rb
@@ -36,10 +36,10 @@ describe RelationshipsController do
   end
 
   describe 'PATCH #update' do
-    let(:poopfeast) { Fabricate(:account, username: 'poopfeast', domain: 'example.com', salmon_url: 'http://example.com/salmon') }
+    let(:poopfeast) { Fabricate(:account, username: 'poopfeast', domain: 'example.com', inbox_url: 'http://example.com/inbox') }
 
     before do
-      stub_request(:post, 'http://example.com/salmon').to_return(status: 200)
+      stub_request(:post, 'http://example.com/inbox').to_return(status: 200)
     end
 
     shared_examples 'redirects back to followers page' do
diff --git a/spec/controllers/remote_unfollows_controller_spec.rb b/spec/controllers/remote_unfollows_controller_spec.rb
index a1a55ede0..e2f3fe4cb 100644
--- a/spec/controllers/remote_unfollows_controller_spec.rb
+++ b/spec/controllers/remote_unfollows_controller_spec.rb
@@ -10,7 +10,7 @@ describe RemoteUnfollowsController do
 
     let(:current_user) { Fabricate(:user, account: current_account) }
     let(:current_account) { Fabricate(:account) }
-    let(:remote_account) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }
+    let(:remote_account) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }
     before do
       sign_in current_user
       current_account.follow!(remote_account)