blacklight-spotlight 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/app/helpers/spotlight/title_helper.rb +1 -1
  4. data/lib/generators/spotlight/install_generator.rb +1 -1
  5. data/lib/spotlight/version.rb +1 -2
  6. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +0 -1
  7. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +0 -1
  8. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +0 -1
  9. data/spec/features/javascript/blocks/featured_pages_block_spec.rb +0 -1
  10. data/spec/features/javascript/blocks/search_result_block_spec.rb +0 -1
  11. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +0 -1
  12. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +0 -1
  13. data/spec/helpers/spotlight/application_helper_spec.rb +4 -11
  14. data/spec/helpers/spotlight/browse_helper_spec.rb +0 -1
  15. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +124 -127
  16. data/spec/helpers/spotlight/jcrop_helper_spec.rb +0 -1
  17. data/spec/helpers/spotlight/navbar_helper_spec.rb +16 -19
  18. data/spec/helpers/spotlight/pages_helper_spec.rb +74 -76
  19. data/spec/helpers/spotlight/roles_helper_spec.rb +0 -1
  20. data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -2
  21. data/spec/helpers/spotlight/title_helper_spec.rb +0 -1
  22. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +0 -1
  23. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +0 -1
  24. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +0 -1
  25. data/spec/models/spotlight/analytics/ga_spec.rb +0 -1
  26. data/spec/models/spotlight/resources/open_graph_spec.rb +0 -1
  27. data/spec/models/spotlight/resources/upload_spec.rb +0 -1
  28. data/spec/models/spotlight/resources/web_spec.rb +0 -1
  29. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +0 -1
  30. data/spec/models/spotlight/solr_document/spotlight_images_spec.rb +0 -1
  31. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +0 -1
  32. data/spec/routing/spotlight/exhibit_catalog_spec.rb +5 -8
  33. data/spec/test_app_templates/catalog_controller.rb +1 -1
  34. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -1
  35. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +0 -1
  36. data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +0 -1
  37. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +0 -1
  38. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +0 -1
  39. data/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb +0 -1
  40. data/spec/views/spotlight/browse/index.html.erb_spec.rb +0 -1
  41. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -1
  42. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +0 -1
  43. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +31 -35
  44. data/spec/views/spotlight/catalog/edit.html.erb_spec.rb +0 -1
  45. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +0 -1
  46. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -1
  47. data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +0 -1
  48. data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +0 -1
  49. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +19 -21
  50. data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +95 -99
  51. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +0 -1
  52. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +0 -1
  53. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +0 -1
  54. data/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb +0 -1
  55. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +19 -23
  56. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +16 -20
  57. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +43 -47
  58. data/spec/views/spotlight/pages/index.html.erb_spec.rb +0 -1
  59. data/spec/views/spotlight/pages/new.html.erb_spec.rb +12 -16
  60. data/spec/views/spotlight/pages/show.html.erb_spec.rb +66 -61
  61. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +0 -1
  62. data/spec/views/spotlight/resources/new.html.erb_spec.rb +0 -1
  63. data/spec/views/spotlight/roles/index.html.erb_spec.rb +20 -25
  64. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +20 -24
  65. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +31 -45
  66. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +19 -24
  67. data/spec/views/spotlight/searches/_search.html.erb_spec.rb +0 -1
  68. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +0 -1
  69. data/spec/views/spotlight/searches/index.html.erb_spec.rb +0 -1
  70. data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +0 -1
  71. data/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb +0 -1
  72. data/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb +0 -1
  73. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +0 -1
  74. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +0 -1
  75. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +0 -1
  76. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +0 -1
  77. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +0 -1
  78. data/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb +18 -24
  79. data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -1
  80. metadata +180 -181
  81. data/lib/generators/spotlight/templates/jetty.rake +0 -19
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/feature_pages/_empty.html.erb', type: :view do
4
3
  let(:can?) { false }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/feature_pages/_sidebar.html.erb', type: :view do
4
3
  let(:exhibit) { FactoryGirl.create(:exhibit) }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/home_pages/_empty.html.erb', type: :view do
4
3
  describe 'resource providers' do
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/home_pages/_sidebar.html.erb', type: :view do
4
3
  before do
@@ -1,27 +1,23 @@
1
- require 'spec_helper'
2
-
3
- module Spotlight
4
- describe 'spotlight/metadata_configurations/_metadata_field', type: :view do
5
- let(:exhibit) { FactoryGirl.create(:exhibit) }
6
- let(:p) { 'spotlight/metadata_configurations/metadata_field.html.erb' }
7
- before do
8
- assign(:exhibit, exhibit)
9
- assign(:blacklight_configuration, exhibit.blacklight_configuration)
10
- allow(view).to receive_messages(
11
- current_exhibit: exhibit,
12
- blacklight_config: exhibit.blacklight_configuration,
13
- available_view_fields: { some_view_type: 1, another_view_type: 2 },
14
- select_deselect_button: nil
15
- )
16
- end
1
+ describe 'spotlight/metadata_configurations/_metadata_field', type: :view do
2
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
3
+ let(:p) { 'spotlight/metadata_configurations/metadata_field.html.erb' }
4
+ before do
5
+ assign(:exhibit, exhibit)
6
+ assign(:blacklight_configuration, exhibit.blacklight_configuration)
7
+ allow(view).to receive_messages(
8
+ current_exhibit: exhibit,
9
+ blacklight_config: exhibit.blacklight_configuration,
10
+ available_view_fields: { some_view_type: 1, another_view_type: 2 },
11
+ select_deselect_button: nil
12
+ )
13
+ end
17
14
 
18
- let(:facet_field) { Blacklight::Configuration::FacetField.new }
19
- let(:builder) { ActionView::Helpers::FormBuilder.new 'z', nil, view, {} }
15
+ let(:facet_field) { Blacklight::Configuration::FacetField.new }
16
+ let(:builder) { ActionView::Helpers::FormBuilder.new 'z', nil, view, {} }
20
17
 
21
- it 'uses the index_field_label helper to render the label' do
22
- allow(view).to receive(:index_field_label).with(nil, 'some_key').and_return 'Some label'
23
- render partial: p, locals: { key: 'some_key', config: facet_field, f: builder }
24
- expect(rendered).to have_selector '.field-label', text: 'Some label'
25
- end
18
+ it 'uses the index_field_label helper to render the label' do
19
+ allow(view).to receive(:index_field_label).with(nil, 'some_key').and_return 'Some label'
20
+ render partial: p, locals: { key: 'some_key', config: facet_field, f: builder }
21
+ expect(rendered).to have_selector '.field-label', text: 'Some label'
26
22
  end
27
23
  end
@@ -1,23 +1,19 @@
1
- require 'spec_helper'
2
-
3
- module Spotlight
4
- describe 'spotlight/metadata_configurations/edit', type: :view do
5
- let(:exhibit) { FactoryGirl.create(:exhibit) }
6
- before do
7
- assign(:exhibit, exhibit)
8
- assign(:blacklight_configuration, exhibit.blacklight_configuration)
9
- allow(view).to receive_messages(
10
- current_exhibit: exhibit,
11
- blacklight_config: exhibit.blacklight_configuration,
12
- available_view_fields: { some_view_type: 1, another_view_type: 2 },
13
- select_deselect_button: nil
14
- )
15
- end
1
+ describe 'spotlight/metadata_configurations/edit', type: :view do
2
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
3
+ before do
4
+ assign(:exhibit, exhibit)
5
+ assign(:blacklight_configuration, exhibit.blacklight_configuration)
6
+ allow(view).to receive_messages(
7
+ current_exhibit: exhibit,
8
+ blacklight_config: exhibit.blacklight_configuration,
9
+ available_view_fields: { some_view_type: 1, another_view_type: 2 },
10
+ select_deselect_button: nil
11
+ )
12
+ end
16
13
 
17
- it 'has columns for the available view types' do
18
- render
19
- expect(rendered).to have_selector 'th', text: 'Some View Type'
20
- expect(rendered).to have_selector 'th', text: 'Another View Type'
21
- end
14
+ it 'has columns for the available view types' do
15
+ render
16
+ expect(rendered).to have_selector 'th', text: 'Some View Type'
17
+ expect(rendered).to have_selector 'th', text: 'Another View Type'
22
18
  end
23
19
  end
@@ -1,68 +1,64 @@
1
- require 'spec_helper'
2
-
3
- module Spotlight
4
- describe 'spotlight/pages/edit', type: :view do
5
- let(:exhibit) { stub_model(Exhibit) }
6
- let(:page) { stub_model(FeaturePage, exhibit: exhibit) }
7
- before do
8
- assign(:page, page)
9
- allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: [])
10
- end
1
+ describe 'spotlight/pages/edit', type: :view do
2
+ let(:exhibit) { stub_model(Spotlight::Exhibit) }
3
+ let(:page) { stub_model(Spotlight::FeaturePage, exhibit: exhibit) }
4
+ before do
5
+ assign(:page, page)
6
+ allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: [])
7
+ end
11
8
 
12
- it 'renders the edit page form' do
13
- render
9
+ it 'renders the edit page form' do
10
+ render
14
11
 
15
- # Run the generator again with the --webrat flag if you want to use webrat matchers
16
- assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_page_path(page.exhibit, page), 'post' do
17
- assert_select 'input#feature_page_title[name=?]', 'feature_page[title]'
18
- assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]'
19
- end
12
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
13
+ assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_page_path(page.exhibit, page), 'post' do
14
+ assert_select 'input#feature_page_title[name=?]', 'feature_page[title]'
15
+ assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]'
20
16
  end
17
+ end
21
18
 
22
- describe 'locks' do
23
- let(:lock) { Lock.create! on: page }
19
+ describe 'locks' do
20
+ let(:lock) { Spotlight::Lock.create! on: page }
24
21
 
25
- before do
26
- page.lock = lock
27
- end
22
+ before do
23
+ page.lock = lock
24
+ end
28
25
 
29
- it 'renders a lock' do
30
- render
26
+ it 'renders a lock' do
27
+ render
31
28
 
32
- expect(rendered).to have_css '.alert-lock'
33
- end
29
+ expect(rendered).to have_css '.alert-lock'
30
+ end
34
31
 
35
- it 'does not render an old lock' do
36
- lock.created_at -= 1.day
32
+ it 'does not render an old lock' do
33
+ lock.created_at -= 1.day
37
34
 
38
- render
35
+ render
39
36
 
40
- expect(rendered).not_to have_css '.alert-lock'
41
- end
37
+ expect(rendered).not_to have_css '.alert-lock'
38
+ end
42
39
 
43
- it 'does not render a lock held by the current session' do
44
- lock.current_session!
40
+ it 'does not render a lock held by the current session' do
41
+ lock.current_session!
45
42
 
46
- render
43
+ render
47
44
 
48
- expect(rendered).not_to have_css '.alert-lock'
49
- end
45
+ expect(rendered).not_to have_css '.alert-lock'
46
+ end
50
47
 
51
- it 'attaches a data-lock attribute to the cancel button' do
52
- lock.current_session!
48
+ it 'attaches a data-lock attribute to the cancel button' do
49
+ lock.current_session!
53
50
 
54
- render
51
+ render
55
52
 
56
- expect(rendered).to have_link 'Cancel'
57
- expect(rendered).to have_css "a[data-lock=\"#{url_for([spotlight, page.exhibit, lock])}\"]", text: 'Cancel'
58
- end
53
+ expect(rendered).to have_link 'Cancel'
54
+ expect(rendered).to have_css "a[data-lock=\"#{url_for([spotlight, page.exhibit, lock])}\"]", text: 'Cancel'
55
+ end
59
56
 
60
- it "does not have data-lock attribute if the lock doesn't belong to this session" do
61
- render
57
+ it "does not have data-lock attribute if the lock doesn't belong to this session" do
58
+ render
62
59
 
63
- expect(rendered).to have_link 'Cancel'
64
- expect(rendered).not_to have_css 'a[data-lock]', text: 'Cancel'
65
- end
60
+ expect(rendered).to have_link 'Cancel'
61
+ expect(rendered).not_to have_css 'a[data-lock]', text: 'Cancel'
66
62
  end
67
63
  end
68
64
  end
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/pages/index.html.erb', type: :view do
4
3
  let(:pages) do
@@ -1,21 +1,17 @@
1
- require 'spec_helper'
2
-
3
- module Spotlight
4
- describe 'spotlight/pages/new', type: :view do
5
- let(:exhibit) { stub_model(Exhibit) }
6
- before do
7
- assign(:page, stub_model(FeaturePage, exhibit: exhibit).as_new_record)
8
- allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: [])
9
- end
1
+ describe 'spotlight/pages/new', type: :view do
2
+ let(:exhibit) { stub_model(Spotlight::Exhibit) }
3
+ before do
4
+ assign(:page, stub_model(Spotlight::FeaturePage, exhibit: exhibit).as_new_record)
5
+ allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: [])
6
+ end
10
7
 
11
- it 'renders new page form' do
12
- render
8
+ it 'renders new page form' do
9
+ render
13
10
 
14
- # Run the generator again with the --webrat flag if you want to use webrat matchers
15
- assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_pages_path(exhibit), 'post' do
16
- assert_select 'input#feature_page_title[name=?]', 'feature_page[title]'
17
- assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]'
18
- end
11
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
12
+ assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_pages_path(exhibit), 'post' do
13
+ assert_select 'input#feature_page_title[name=?]', 'feature_page[title]'
14
+ assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]'
19
15
  end
20
16
  end
21
17
  end
@@ -1,63 +1,68 @@
1
- require 'spec_helper'
2
-
3
- module Spotlight
4
- describe 'spotlight/pages/show', type: :view do
5
- let(:exhibit) { stub_model(Exhibit) }
6
- let(:page) do
7
- stub_model(FeaturePage,
8
- exhibit: exhibit,
9
- title: 'Title',
10
- content: '[]')
11
- end
12
- before(:each) do
13
- allow(view).to receive(:current_exhibit).and_return(exhibit)
14
- assign(:page, page)
15
- stub_template 'spotlight/pages/_sidebar.html.erb' => 'Sidebar'
16
- end
17
-
18
- it 'renders the title as a heading' do
19
- render
20
- expect(rendered).to have_css('.page-title', text: page.title)
21
- end
22
- it 'does not render an empty heading' do
23
- allow(page).to receive_messages(title: nil)
24
- render
25
- expect(rendered).to_not have_css('.page-title')
26
- end
27
-
28
- it 'injects the page title into the html title' do
29
- expect(view).to receive(:set_html_page_title)
30
- render
31
- end
32
-
33
- it 'does not include the page title' do
34
- allow(page).to receive_messages(should_display_title?: false)
35
- expect(view).to_not receive(:set_html_page_title)
36
- render
37
- end
38
-
39
- it 'renders attributes in <p>' do
40
- render
41
- expect(rendered).to match(/Title/)
42
- end
43
-
44
- it 'renders the sidebar' do
45
- page.display_sidebar = true
46
- render
47
- expect(rendered).to match('Sidebar')
48
- end
49
-
50
- it 'does not render the sidebar if the page has it disabled' do
51
- allow(page).to receive_messages(display_sidebar?: false)
52
- render
53
- expect(rendered).to_not match('Sidebar')
54
- end
55
-
56
- it 'renders an empty partial if the page has no content' do
57
- allow(page).to receive_messages(content?: false)
58
- stub_template 'spotlight/pages/_empty.html.erb' => 'Empty message'
59
- render
60
- expect(rendered).to have_content('Empty message')
61
- end
1
+ describe 'spotlight/pages/show', type: :view do
2
+ let(:exhibit) { stub_model(Spotlight::Exhibit) }
3
+ let(:page) do
4
+ stub_model(Spotlight::FeaturePage,
5
+ exhibit: exhibit,
6
+ title: 'Title',
7
+ content: '[]')
8
+ end
9
+ before(:each) do
10
+ allow(view).to receive(:current_exhibit).and_return(exhibit)
11
+ assign(:page, page)
12
+ stub_template 'spotlight/pages/_sidebar.html.erb' => 'Sidebar'
13
+ end
14
+
15
+ it 'renders the title as a heading' do
16
+ render
17
+ expect(rendered).to have_css('.page-title', text: page.title)
18
+ end
19
+
20
+ it 'does not render an empty heading' do
21
+ allow(page).to receive_messages(title: nil)
22
+ render
23
+ expect(rendered).to_not have_css('.page-title')
24
+ end
25
+
26
+ it 'injects the page title into the html title' do
27
+ expect(view).to receive(:set_html_page_title)
28
+ render
29
+ end
30
+
31
+ it 'does not double-escape HTML entities in the HTML title' do
32
+ allow(page).to receive_messages(title: 'Abbott & Costello')
33
+ stub_template '_user_util_links.html.erb' => ''
34
+ stub_template 'shared/_masthead.html.erb' => ''
35
+ render template: 'spotlight/pages/show', layout: 'layouts/spotlight/spotlight'
36
+ expect(rendered).to have_content('Abbott & Costello | Blacklight')
37
+ end
38
+
39
+ it 'does not include the page title' do
40
+ allow(page).to receive_messages(should_display_title?: false)
41
+ expect(view).to_not receive(:set_html_page_title)
42
+ render
43
+ end
44
+
45
+ it 'renders attributes in <p>' do
46
+ render
47
+ expect(rendered).to match(/Title/)
48
+ end
49
+
50
+ it 'renders the sidebar' do
51
+ page.display_sidebar = true
52
+ render
53
+ expect(rendered).to match('Sidebar')
54
+ end
55
+
56
+ it 'does not render the sidebar if the page has it disabled' do
57
+ allow(page).to receive_messages(display_sidebar?: false)
58
+ render
59
+ expect(rendered).to_not match('Sidebar')
60
+ end
61
+
62
+ it 'renders an empty partial if the page has no content' do
63
+ allow(page).to receive_messages(content?: false)
64
+ stub_template 'spotlight/pages/_empty.html.erb' => 'Empty message'
65
+ render
66
+ expect(rendered).to have_content('Empty message')
62
67
  end
63
68
  end
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/resources/_external_resources_form.html.erb', type: :view do
4
3
  let(:blacklight_config) { Blacklight::Configuration.new }
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
 
3
2
  describe 'spotlight/resources/new.html.erb', type: :view do
4
3
  let(:blacklight_config) { Blacklight::Configuration.new }
@@ -1,31 +1,26 @@
1
- require 'spec_helper'
1
+ describe 'spotlight/roles/index', type: :view do
2
+ let(:user) { stub_model(Spotlight::Engine.user_class, email: 'jane@example.com') }
3
+ let(:exhibit) { FactoryGirl.create(:exhibit) }
4
+ let(:admin_role) { FactoryGirl.create(:role, role: 'admin', user: user, resource: exhibit) }
5
+ let(:roles) { [admin_role] }
2
6
 
3
- module Spotlight
4
- describe 'spotlight/roles/index', type: :view do
5
- let(:user) { stub_model(Spotlight::Engine.user_class, email: 'jane@example.com') }
6
-
7
- let(:exhibit) { FactoryGirl.create(:exhibit) }
8
- let(:admin_role) { FactoryGirl.create(:role, role: 'admin', user: user, resource: exhibit) }
9
- let(:roles) { [admin_role] }
10
-
11
- before do
12
- assign(:exhibit, exhibit)
13
- allow(view).to receive(:current_exhibit).and_return(exhibit)
14
- allow(exhibit).to receive(:roles).and_return roles
15
- end
7
+ before do
8
+ assign(:exhibit, exhibit)
9
+ allow(view).to receive(:current_exhibit).and_return(exhibit)
10
+ allow(exhibit).to receive(:roles).and_return roles
11
+ end
16
12
 
17
- it 'renders the index page form' do
18
- render
13
+ it 'renders the index page form' do
14
+ render
19
15
 
20
- action = spotlight.update_all_exhibit_roles_path(exhibit)
21
- assert_select "form[action='#{action}'][method='post']" do
22
- assert_select "tr[data-show-for='#{admin_role.id}']"
23
- assert_select "tr[data-edit-for='#{admin_role.id}']"
24
- assert_select "input[type='submit'][data-behavior='destroy-user'][data-target='#{admin_role.id}']"
25
- assert_select "input[type='hidden'][data-destroy-for='#{admin_role.id}']"
26
- assert_select "a[data-behavior='cancel-edit']"
27
- assert_select "input[type='submit'][value='Save changes']"
28
- end
16
+ action = spotlight.update_all_exhibit_roles_path(exhibit)
17
+ assert_select "form[action='#{action}'][method='post']" do
18
+ assert_select "tr[data-show-for='#{admin_role.id}']"
19
+ assert_select "tr[data-edit-for='#{admin_role.id}']"
20
+ assert_select "input[type='submit'][data-behavior='destroy-user'][data-target='#{admin_role.id}']"
21
+ assert_select "input[type='hidden'][data-destroy-for='#{admin_role.id}']"
22
+ assert_select "a[data-behavior='cancel-edit']"
23
+ assert_select "input[type='submit'][value='Save changes']"
29
24
  end
30
25
  end
31
26
  end