Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 5c914d0

Browse files
committed
Fixed rspec issues with latest AA
1 parent 55505c9 commit 5c914d0

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gemspec
1515

1616
# Gems used by the dummy application
1717
gem 'rails', '~> 4.0.0'
18-
gem 'sass-rails'
18+
gem 'sass-rails', '~> 4.0.2'
1919
gem 'coffee-rails'
2020

2121
# See https://github.com/sstephenson/execjs#readme for more supported runtimes

spec/dummy/app/admin/dashboard.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ActiveAdmin.register_page "Dashboard" do
22

3-
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
3+
menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }
44

5-
content :title => proc{ I18n.t("active_admin.dashboard") } do
6-
div :class => "blank_slate_container", :id => "dashboard_default_message" do
7-
span :class => "blank_slate" do
5+
content title: proc{ I18n.t("active_admin.dashboard") } do
6+
div class: "blank_slate_container", id: "dashboard_default_message" do
7+
span class: "blank_slate" do
88
span I18n.t("active_admin.dashboard_welcome.welcome")
99
small I18n.t("active_admin.dashboard_welcome.call_to_action")
1010
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#= require active_admin/base

spec/dummy/config/initializers/active_admin.rb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
# Set an optional image to be displayed for the header
1616
# instead of a string (overrides :site_title)
1717
#
18-
# Note: Recommended image height is 21px to properly fit in the header
18+
# Note: Aim for an image that's 21px high so it fits in the header.
1919
#
20-
# config.site_title_image = "/images/logo.png"
20+
# config.site_title_image = "logo.png"
2121

2222
# == Default Namespace
2323
#
@@ -54,7 +54,7 @@
5454
# ensure that there is a currently logged in admin user.
5555
#
5656
# This setting changes the method which Active Admin calls
57-
# within the controller.
57+
# within the application controller.
5858
config.authentication_method = :authenticate_admin_user!
5959

6060
# == User Authorization
@@ -81,7 +81,7 @@
8181
# user performing them.
8282
#
8383
# This setting changes the method which Active Admin calls
84-
# to return the currently logged in user.
84+
# (within the application controller) to return the currently logged in user.
8585
config.current_user_method = :current_admin_user
8686

8787

@@ -118,8 +118,8 @@
118118
# This allows your users to comment on any resource registered with Active Admin.
119119
#
120120
# You can completely disable comments:
121-
config.allow_comments = false
122-
121+
# config.allow_comments = false
122+
#
123123
# You can disable the menu item for the comments index page:
124124
# config.show_comments_in_menu = false
125125
#
@@ -140,13 +140,21 @@
140140
# Active Admin resources and pages from here.
141141
#
142142
# config.before_filter :do_something_awesome
143-
144-
143+
144+
145145
# == Setting a Favicon
146146
#
147147
# config.favicon = '/assets/favicon.ico'
148148

149149

150+
# == Removing Breadcrumbs
151+
#
152+
# Breadcrumbs are enabled by default. You can customize them for individual
153+
# resources or you can disable them globally from here.
154+
#
155+
# config.breadcrumb = false
156+
157+
150158
# == Register Stylesheets & Javascripts
151159
#
152160
# We recommend using the built in Active Admin layout and loading
@@ -209,6 +217,10 @@
209217
# # Only show XML & PDF options
210218
# admin.download_links = [:xml, :pdf]
211219
#
220+
# # Enable/disable the links based on block
221+
# # (for example, with cancan)
222+
# admin.download_links = proc { can?(:view_download_links) }
223+
#
212224
# end
213225

214226

spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
require 'rspec/rails'
55
require 'rspec/autorun'
66

7+
# Needed in rails4 to run specs, see https://github.com/activeadmin/activeadmin/issues/2712#issuecomment-46798603
8+
require_relative 'dummy/app/admin/articles'
9+
require_relative 'dummy/app/admin/admin_users'
10+
require_relative 'dummy/app/admin/dashboard'
11+
require_relative 'dummy/config/routes'
12+
713
# Requires supporting ruby files with custom matchers and macros, etc,
814
# in spec/support/ and its subdirectories.
915
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

0 commit comments

Comments
 (0)