]> cat aescling's git repositories - mastodon.git/commitdiff
Fix flashes partial render error for controllers which don't inherit from application...
authorMatt Jankowski <mjankowski@thoughtbot.com>
Mon, 24 Apr 2017 15:30:30 +0000 (11:30 -0400)
committerEugen <eugen@zeonfederated.com>
Mon, 24 Apr 2017 15:30:30 +0000 (17:30 +0200)
* Add failing spec for oauth/authorized_applications controller

* Use explicit reference to flashes partial from admin layout

Because some of the controllers which use the admin layout do not inherit from
application controller, this partial is not in their view path.

app/views/layouts/admin.html.haml
spec/controllers/oauth/authorized_applications_controller_spec.rb [new file with mode: 0644]

index d2cff5e303a95989234025635cf1ae2d539e656a..d3d97e3a0422f793e8a9944c2d85d598d4c234c5 100644 (file)
@@ -13,7 +13,7 @@
       .content
         %h2= yield :page_title
 
-        = render 'flashes'
+        = render 'application/flashes'
 
         = yield
 
diff --git a/spec/controllers/oauth/authorized_applications_controller_spec.rb b/spec/controllers/oauth/authorized_applications_controller_spec.rb
new file mode 100644 (file)
index 0000000..f5d64bd
--- /dev/null
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Oauth::AuthorizedApplicationsController do
+  render_views
+
+  before do
+    sign_in Fabricate(:user), scope: :user
+  end
+
+  describe 'GET #index' do
+    before do
+      get :index
+    end
+
+    it 'returns http success' do
+      expect(response).to have_http_status(:success)
+    end
+  end
+end