File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,21 @@ Feature: Dashboard
2424 Then I should not see the default welcome message
2525 And I should see a dashboard widget "Hello World"
2626 And I should see "Hello world from the content"
27+
28+ Scenario : Displaying a dashboard widget using the ':if' option
29+ Given a configuration of:
30+ """
31+ ActiveAdmin::Dashboards.build do
32+ section 'Hello World', :if => proc{ current_admin_user } do
33+ "Hello world from the content"
34+ end
35+
36+ section 'Hidden by If', :if => proc{ false } do
37+ "Hello world from the content"
38+ end
39+ end
40+ """
41+ When I go to the dashboard
42+ Then I should not see the default welcome message
43+ And I should see a dashboard widget "Hello World"
44+ And I should not see a dashboard widget "Hidden by If"
Original file line number Diff line number Diff line change 77end
88
99Then /^I should see a dashboard widget "([^"]*)"$/ do |name |
10- Then %{I should see "#{ name } " within ".dashboard .panel h3"}
10+ page . should have_css ( '.dashboard .panel h3' , :text => name )
11+ end
12+
13+ Then /^I should not see a dashboard widget "([^"]*)"$/ do |name |
14+ page . should_not have_css ( '.dashboard .panel h3' , :text => name )
1115end
You can’t perform that action at this time.
0 commit comments