]> cat aescling's git repositories - mastodon.git/commitdiff
Fix remote follow (#2547)
authorMatt Jankowski <mjankowski@thoughtbot.com>
Thu, 27 Apr 2017 22:16:44 +0000 (18:16 -0400)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 27 Apr 2017 22:16:44 +0000 (00:16 +0200)
* Add coverage for remote_follow#new

* Fix reference to authorize_follows/card partial

app/views/remote_follow/new.html.haml
spec/controllers/remote_follow_controller_spec.rb [new file with mode: 0644]

index e88ccccce53ad064dc8a59a86fc184ea41af9935..fa48e5e627b4a70abd034c1fda34a5013a1920e3 100644 (file)
@@ -2,7 +2,7 @@
   .follow-prompt
     %h2= t('remote_follow.prompt')
 
-    = render partial: 'authorize_follow/card', locals: { account: @account }
+    = render partial: 'authorize_follows/card', locals: { account: @account }
 
   = simple_form_for @remote_follow, as: :remote_follow, url: account_remote_follow_path(@account) do |f|
     = render 'shared/error_messages', object: @remote_follow
diff --git a/spec/controllers/remote_follow_controller_spec.rb b/spec/controllers/remote_follow_controller_spec.rb
new file mode 100644 (file)
index 0000000..1c9e6a4
--- /dev/null
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe RemoteFollowController do
+  render_views
+
+  describe '#new' do
+    it 'returns a success' do
+      account = Fabricate(:account)
+      get :new, params: { account_username: account.to_param }
+
+      expect(response).to have_http_status(:success)
+    end
+  end
+end