diff --git a/.hound.yml b/.hound.yml index 8331f4615..af42214d4 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,6 +1,5 @@ ruby: - enabled: true - config_file: .rubocop.yml + enabled: false scss: enabled: true diff --git a/Gemfile b/Gemfile index 6fc6f446d..ad806d77c 100644 --- a/Gemfile +++ b/Gemfile @@ -95,11 +95,6 @@ gem 'peek-redis' gem 'flipflop', '~> 2.3' gem 'lograge' -# Pinned up tight until these are resolved: -# https://github.com/PerfectlyNormal/tinymce-rails-imageupload/issues/86 -# https://github.com/PerfectlyNormal/tinymce-rails-imageupload/issues/87 -gem 'tinymce-rails-imageupload', '4.0.17.beta' - gem 'zk' gem 'mods', '~> 2.1' diff --git a/Gemfile.lock b/Gemfile.lock index d4b71a147..3d4c6d9e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/projecthydra-labs/hyrax.git - revision: 731ac86078436f96329ea0bf8a3aa050ff7ee1ab + revision: 211d3ef43f221719783f92f011514f2dc135886a specs: hyrax (2.0.0.alpha) active-fedora (>= 11.1.3) @@ -36,8 +36,8 @@ GIT posix-spawn power_converter (~> 0.1, >= 0.1.2) qa (~> 1.0) + rails (~> 5.0) rails_autolink (~> 1.1) - railties (~> 5.0) rdf-rdfxml redis-namespace (~> 1.5.2) redlock (>= 0.1.2) @@ -92,7 +92,7 @@ GEM active_elastic_job (2.0.1) aws-sdk (~> 2) rails (>= 4.2) - active_fedora-noid (2.1.0) + active_fedora-noid (2.2.0) active-fedora (>= 9.7, < 12) noid (~> 0.9) rails (>= 5.0.0, < 6) @@ -126,13 +126,13 @@ GEM execjs awesome_nested_set (3.1.3) activerecord (>= 4.0.0, < 5.2) - aws-sdk (2.9.23) - aws-sdk-resources (= 2.9.23) - aws-sdk-core (2.9.23) + aws-sdk (2.9.28) + aws-sdk-resources (= 2.9.28) + aws-sdk-core (2.9.28) aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.9.23) - aws-sdk-core (= 2.9.23) + aws-sdk-resources (2.9.28) + aws-sdk-core (= 2.9.28) aws-sigv4 (1.0.0) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -244,7 +244,7 @@ GEM dry-container (0.6.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.3.0) + dry-core (0.3.1) concurrent-ruby (~> 1.0) dry-equalizer (0.2.0) dry-logic (0.4.1) @@ -299,15 +299,15 @@ GEM railties (>= 3.2, < 5.2) globalid (0.4.0) activesupport (>= 4.2.0) - google-api-client (0.11.2) + google-api-client (0.11.3) addressable (>= 2.5.1) googleauth (~> 0.5) httpclient (>= 2.8.1, < 3.0) mime-types (>= 3.0) representable (~> 3.0) retriable (>= 2.0, < 4.0) - google_drive (2.1.3) - google-api-client (>= 0.11.0, < 1.0.0) + google_drive (2.1.4) + google-api-client (>= 0.11.0, < 0.12.0) googleauth (>= 0.5.0, < 1.0.0) nokogiri (>= 1.5.3, < 2.0.0) googleauth (0.5.1) @@ -372,7 +372,7 @@ GEM hydra-file_characterization (~> 0.3, >= 0.3.3) hydra-pcdm (>= 0.9) om (~> 3.1) - i18n (0.8.1) + i18n (0.8.4) i18n-debug (1.1.0) i18n (< 1) ice_nine (0.11.2) @@ -501,7 +501,7 @@ GEM nest (2.1.0) redic net-http-persistent (2.9.4) - nio4r (2.0.0) + nio4r (2.1.0) noid (0.9.0) nokogiri (1.7.2) mini_portile2 (~> 2.1.0) @@ -509,7 +509,7 @@ GEM activesupport (>= 3.2.18) i18n nokogiri - oauth (0.5.2) + oauth (0.5.3) oauth2 (1.3.1) faraday (>= 0.8, < 0.12) jwt (~> 1.0) @@ -804,11 +804,8 @@ GEM thread_safe (0.3.6) tilt (2.0.7) tins (1.14.0) - tinymce-rails (4.6.2) + tinymce-rails (4.6.3) railties (>= 3.1.1) - tinymce-rails-imageupload (4.0.17.beta) - railties (>= 3.2, < 6) - tinymce-rails (~> 4.0) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.3) @@ -902,7 +899,6 @@ DEPENDENCIES solr_wrapper (~> 1.0) spring (~> 1.7) spring-watcher-listen (~> 2.0.0) - tinymce-rails-imageupload (= 4.0.17.beta) turbolinks (~> 5) uglifier (>= 1.3.0) web-console (>= 3.3.0) diff --git a/app/controllers/content_blocks_controller.rb b/app/controllers/content_blocks_controller.rb deleted file mode 100644 index a5fbe9cd3..000000000 --- a/app/controllers/content_blocks_controller.rb +++ /dev/null @@ -1,31 +0,0 @@ -class ContentBlocksController < SitesController - # GET /sites/1/edit - def edit - add_breadcrumb t(:'hyrax.controls.home'), root_path - add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path - add_breadcrumb t(:'hyrax.admin.sidebar.content_blocks'), edit_site_content_blocks_path - end - - # PATCH/PUT /sites/1 - # PATCH/PUT /sites/1.json - def update - respond_to do |format| - if @site.update(site_params) - format.html { redirect_to edit_site_content_blocks_path, notice: 'Site was successfully updated.' } - else - format.html { render :edit } - end - end - end - - private - - # Never trust parameters from the scary internet, only allow the white list through. - def site_params - params.require(:site).permit(:announcement_text, - :marketing_text, - :featured_researcher, - :about_page, - :help_page) - end -end diff --git a/app/controllers/labels_controller.rb b/app/controllers/labels_controller.rb index f32de3125..911478fb5 100644 --- a/app/controllers/labels_controller.rb +++ b/app/controllers/labels_controller.rb @@ -3,6 +3,7 @@ class LabelsController < SitesController def edit add_breadcrumb t(:'hyrax.controls.home'), root_path add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path + add_breadcrumb t(:'hyrax.admin.sidebar.configuration'), '#' add_breadcrumb t(:'hyrax.admin.sidebar.labels'), edit_site_labels_path end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6620169ff..3b06ebb3f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,5 +1,4 @@ module ApplicationHelper include ::HyraxHelper - include ContentBlockHelper include GroupNavigationHelper end diff --git a/app/helpers/content_block_helper.rb b/app/helpers/content_block_helper.rb deleted file mode 100644 index f0e66f6ef..000000000 --- a/app/helpers/content_block_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module ContentBlockHelper - include Hyrax::ContentBlockHelperBehavior - - # This is like editable_content_block in hyrax, but it doesn't allow editing - # rubocop:disable Rails/OutputSafety - def displayable_content_block(content_block, **options) - return if content_block.value.blank? - content_tag :div, raw(content_block.value), options - end - # rubocop:enable Rails/OutputSafety -end diff --git a/app/models/content_block.rb b/app/models/content_block.rb deleted file mode 100644 index 2f7e7ee8e..000000000 --- a/app/models/content_block.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ContentBlock < ActiveRecord::Base - include Hyrax::ContentBlockBehavior - include Hyku::ContentBlockBehavior -end diff --git a/app/models/hyku/content_block_behavior.rb b/app/models/hyku/content_block_behavior.rb deleted file mode 100644 index b2b362168..000000000 --- a/app/models/hyku/content_block_behavior.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Hyku - module ContentBlockBehavior - extend ActiveSupport::Concern - - ABOUT = 'about_page'.freeze - HELP = 'help_page'.freeze - - included do - belongs_to :site - end - - class_methods do - def default_scope - where(site_id: Site.instance.id) - end - - def about_page - find_or_create_by(name: ABOUT) - end - - def about_page=(value) - about_page.update(value: value) - end - - def help_page - find_or_create_by(name: HELP) - end - - def help_page=(value) - help_page.update(value: value) - end - end - end -end diff --git a/app/models/site.rb b/app/models/site.rb index 35b195411..0ac42cd8b 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -7,20 +7,11 @@ class Site < ActiveRecord::Base mount_uploader :banner_image, BannerImageUploader belongs_to :account - has_many :content_blocks accepts_nested_attributes_for :account, update_only: true - delegate :announcement_text, :marketing_text, :featured_researcher, - :announcement_text=, :marketing_text=, :featured_researcher=, - :about_page, :about_page=, :help_page, :help_page=, - to: :content_blocks - class << self delegate :account, :application_name, :institution_name, - :institution_name_full, :reload, :update, :announcement_text, - :marketing_text, :featured_researcher, :announcement_text=, - :marketing_text=, :featured_researcher=, - :about_page, :about_page=, :help_page, :help_page=, + :institution_name_full, :reload, :update, to: :instance def instance diff --git a/app/presenters/hyku/menu_presenter.rb b/app/presenters/hyku/menu_presenter.rb index 6aabf15b3..bcd01c960 100644 --- a/app/presenters/hyku/menu_presenter.rb +++ b/app/presenters/hyku/menu_presenter.rb @@ -4,7 +4,7 @@ class MenuPresenter < Hyrax::MenuPresenter # Returns true if the current controller happens to be one of the controllers that deals # with settings. This is used to keep the parent section on the sidebar open. def settings_section? - %w(appearances content_blocks labels features).include?(controller_name) + %w(appearances content_blocks labels features pages).include?(controller_name) end # Returns true if the current controller happens to be one of the controllers that deals diff --git a/app/views/content_blocks/_form.html.erb b/app/views/content_blocks/_form.html.erb deleted file mode 100644 index 7232876d1..000000000 --- a/app/views/content_blocks/_form.html.erb +++ /dev/null @@ -1,101 +0,0 @@ -
- -
-
-
- <%= simple_form_for @site, url: site_content_blocks_path do |f| %> -
-
- <%= f.label :about_page %>
- <%= f.text_area :about_page, value: f.object.about_page.value, class: 'form-control tinymce', rows: 20, cols: 120 %> -
-
- - <% end %> -
-
-
-
- <%= simple_form_for @site, url: site_content_blocks_path do |f| %> -
-
- <%= f.label :help_page %>
- <%= f.text_area :help_page, value: f.object.help_page.value, class: 'form-control tinymce', rows: 20, cols: 120 %> -
-
- - <% end %> -
-
-
-
- <%= simple_form_for @site, url: site_content_blocks_path do |f| %> -
-
- <%= f.label :marketing_text %>
- <%= f.text_area :marketing_text, value: f.object.marketing_text.value, class: 'form-control tinymce', rows: 20, cols: 120 %> -
-
- - <% end %> -
-
-
-
- <%= simple_form_for @site, url: site_content_blocks_path do |f| %> -
-
- <%= f.label :announcement_text %>
- <%= f.text_area :announcement_text, value: f.object.announcement_text.value, class: 'form-control tinymce', rows: 20, cols: 120 %> -
-
- - <% end %> -
-
- -
-
diff --git a/app/views/content_blocks/edit.html.erb b/app/views/content_blocks/edit.html.erb deleted file mode 100644 index c8e91e068..000000000 --- a/app/views/content_blocks/edit.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% content_for :page_header do %> -

<%= t(:'hyrax.admin.sidebar.content_blocks') %>

-<% end %> - -
-
- <%= render 'form' %> -
-
diff --git a/app/views/hyrax/dashboard/_sidebar.html.erb b/app/views/hyrax/dashboard/_sidebar.html.erb index e5911713b..c49c85c41 100644 --- a/app/views/hyrax/dashboard/_sidebar.html.erb +++ b/app/views/hyrax/dashboard/_sidebar.html.erb @@ -96,8 +96,11 @@ <%= t('hyrax.admin.sidebar.appearance') %> <% end %> <% end %> - <%= menu.nav_link(main_app.edit_site_content_blocks_path) do %> - <%= t('hyrax.admin.sidebar.content_blocks') %> + <%= menu.nav_link(hyrax.edit_pages_path) do %> + <%= t('hyrax.admin.sidebar.pages') %> + <% end %> + <%= menu.nav_link(hyrax.edit_content_blocks_path) do %> + <%= t('hyrax.admin.sidebar.content_blocks') %> <% end %> <%= menu.nav_link(hyrax.admin_features_path) do %> Technical diff --git a/app/views/hyrax/homepage/_announcement.html.erb b/app/views/hyrax/homepage/_announcement.html.erb deleted file mode 100644 index dc0d97990..000000000 --- a/app/views/hyrax/homepage/_announcement.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= displayable_content_block @announcement_text, class: 'row', id: 'announcement' %> diff --git a/app/views/hyrax/homepage/_marketing.html.erb b/app/views/hyrax/homepage/_marketing.html.erb deleted file mode 100644 index 4ed2b52ee..000000000 --- a/app/views/hyrax/homepage/_marketing.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= displayable_content_block @marketing_text, class: 'col-sm-offset-2 col-sm-9 col-md-offset-1 home_marketing_text' %> diff --git a/app/views/hyrax/pages/show.html.erb b/app/views/hyrax/pages/show.html.erb deleted file mode 100644 index 411a6060c..000000000 --- a/app/views/hyrax/pages/show.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= displayable_content_block @page, class: 'row', id: 'content_block_page' %> diff --git a/config/application.rb b/config/application.rb index 6ca3d41c4..924d0b995 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,11 +17,6 @@ class Application < Rails::Application # configuring Nginx on Elastic Beanstalk is a pain. config.middleware.use Rack::Deflater - # The compile method (default in tinymce-rails 4.5.2) doesn't work when also - # using tinymce-rails-imageupload, so revert to the :copy method - # https://github.com/spohlenz/tinymce-rails/issues/183 - config.tinymce.install = :copy - # The locale is set by a query parameter, so if it's not found render 404 config.action_dispatch.rescue_responses.merge!( "I18n::InvalidLocale" => :not_found @@ -51,6 +46,5 @@ class Application < Rails::Application end end end - end end diff --git a/config/routes.rb b/config/routes.rb index fc64f88e5..fe5bbba14 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,6 @@ mount BrowseEverything::Engine => '/browse' resource :site, only: [:update] do resources :roles, only: [:index, :update] - resource :content_blocks, only: [:edit, :update] resource :labels, only: [:edit, :update] end diff --git a/spec/controllers/content_blocks_controller_spec.rb b/spec/controllers/content_blocks_controller_spec.rb deleted file mode 100644 index 565862e43..000000000 --- a/spec/controllers/content_blocks_controller_spec.rb +++ /dev/null @@ -1,104 +0,0 @@ -# This spec was generated by rspec-rails when you ran the scaffold generator. -# It demonstrates how one might use RSpec to specify the controller code that -# was generated by Rails when you ran the scaffold generator. -# -# It assumes that the implementation code is generated by the rails scaffold -# generator. If you are using any extension libraries to generate different -# controller code, this generated spec may or may not pass. -# -# It only uses APIs available in rails and/or rspec-rails. There are a number -# of tools you can use to make these specs even more expressive, but we're -# sticking to rails and rspec-rails APIs to keep things simple and stable. -# -# Compared to earlier versions of this generator, there is very limited use of -# stubs and message expectations in this spec. Stubs are only used when there -# is no simpler way to get a handle on the object needed for the example. -# Message expectations are only used when there is no simpler way to specify -# that an instance is receiving a specific message. - -RSpec.describe ContentBlocksController, type: :controller do - before do - sign_in user - end - - let(:valid_attributes) do - { - announcement_text: 'This is announcement text!', - marketing_text: 'This is marketing text!', - featured_researcher: 'This is featured researcher!', - about_page: 'This page is about us!', - help_page: 'This page will provide all the help you need.' - } - end - - context 'with an unprivileged user' do - let(:user) { FactoryGirl.create(:user) } - - describe "GET #edit" do - it "denies the request" do - get :edit, params: { site: valid_attributes } - expect(response).to have_http_status(401) - end - end - - describe "PUT #update" do - it "denies the request" do - put :update, params: { site: valid_attributes } - expect(response).to have_http_status(401) - end - end - end - - context 'with an administrator' do - let(:user) { FactoryGirl.create(:admin) } - - describe "GET #edit" do - it "assigns the requested site as @site" do - get :edit - expect(assigns(:site)).to eq(Site.instance) - end - end - - describe "PUT #update" do - context "with valid params" do - let(:new_attributes) do - { - announcement_text: 'This is new announcement text!', - marketing_text: 'This is new marketing text!', - featured_researcher: 'This is a new featured researcher!', - about_page: 'This is a new page about us!', - help_page: 'This page will provide more of the help you need.' - } - end - - before do - FactoryGirl.create(:content_block, name: 'announcement_text') - FactoryGirl.create(:content_block, name: 'marketing_text') - FactoryGirl.create(:content_block, name: 'featured_researcher') - FactoryGirl.create(:content_block, name: 'about_page') - FactoryGirl.create(:content_block, name: 'help_page') - end - - it "updates the requested site" do - put :update, params: { site: new_attributes } - Site.reload - expect(Site.announcement_text.value).to eq "This is new announcement text!" - expect(Site.marketing_text.value).to eq "This is new marketing text!" - expect(Site.featured_researcher.value).to eq "This is a new featured researcher!" - expect(Site.about_page.value).to eq "This is a new page about us!" - expect(Site.help_page.value).to eq "This page will provide more of the help you need." - end - - it "assigns the requested site as @site" do - put :update, params: { site: valid_attributes } - expect(assigns(:site)).to eq(Site.instance) - end - - it "redirects to the site" do - put :update, params: { site: valid_attributes } - expect(response).to redirect_to(edit_site_content_blocks_path) - end - end - end - end -end diff --git a/spec/factories/content_blocks.rb b/spec/factories/content_blocks.rb deleted file mode 100644 index 9acd63f18..000000000 --- a/spec/factories/content_blocks.rb +++ /dev/null @@ -1,4 +0,0 @@ -FactoryGirl.define do - factory :content_block do - end -end diff --git a/spec/features/content_blocks_spec.rb b/spec/features/content_blocks_spec.rb deleted file mode 100644 index 4d19eb7d4..000000000 --- a/spec/features/content_blocks_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -RSpec.describe 'Site content blocks configuration' do - context 'as an administrator' do - let(:user) { FactoryGirl.create(:admin) } - - before do - login_as(user, scope: :user) - end - - describe 'homepage content blocks' do - before do - Site.update( - announcement_text: 'FOO', - marketing_text: 'BAZ', - featured_researcher: 'QUUX' - ) - end - it 'updates the homepage' do - visit root_path - expect(page).to have_content('FOO') - expect(page).to have_content('BAZ') - expect(page).to have_content('QUUX') - end - end - - describe 'about page content blocks' do - before do - Site.update( - about_page: 'FOOM' - ) - end - it 'updates the about page' do - visit hyrax.about_path - expect(page).to have_content('FOOM') - end - end - end -end diff --git a/spec/helpers/content_block_helper_spec.rb b/spec/helpers/content_block_helper_spec.rb deleted file mode 100644 index af986a479..000000000 --- a/spec/helpers/content_block_helper_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -RSpec.describe ContentBlockHelper, type: :helper do - describe '#displayable_content_block' do - it 'is defined' do - expect(helper).to respond_to(:displayable_content_block) - end - - subject { helper.displayable_content_block(content_block, options) } - let(:options) { {} } - context 'when a block has a nil value' do - let(:content_block) { double(value: nil) } - it { is_expected.to be_nil } - end - context 'when a block has an empty string value' do - let(:content_block) { double(value: '') } - it { is_expected.to be_nil } - end - context 'when a block has a non-empty string value' do - let(:content_block) { double(value: value) } - let(:value) { '

foobarbaz

' } - it { is_expected.to eq "
#{value}
" } - context 'with options' do - let(:options) { { id: 'my_id', class: 'huge' } } - it { is_expected.to eq "
#{value}
" } - end - end - end -end diff --git a/spec/models/content_block_spec.rb b/spec/models/content_block_spec.rb deleted file mode 100644 index 19979ec2a..000000000 --- a/spec/models/content_block_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -RSpec.describe ContentBlock, type: :model do - describe '.default_scope' do - subject { described_class.about_page.site } - it 'has an associated Site' do - is_expected.to eq Site.instance - end - end - - context "the about page" do - before do - create(:content_block, - name: ContentBlock::ABOUT, - value: '

About Page

') - end - - describe 'getter' do - subject { described_class.about_page.value } - it { is_expected.to eq '

About Page

' } - end - - describe 'setter' do - let(:new_about) { '

Foobarfoo

' } - it 'sets a new about_page' do - described_class.about_page = new_about - expect(described_class.about_page.value).to eq new_about - end - end - end - - context "the help page" do - before do - create(:content_block, - name: ContentBlock::HELP, - value: '

Help Page

') - end - - describe 'getter' do - subject { described_class.help_page.value } - it { is_expected.to eq '

Help Page

' } - end - - describe 'setter' do - let(:new_help) { '

Foobarfoo

' } - it 'sets a new help_page' do - described_class.help_page = new_help - expect(described_class.help_page.value).to eq new_help - end - end - end -end diff --git a/spec/presenters/hyku/menu_presenter_spec.rb b/spec/presenters/hyku/menu_presenter_spec.rb index 46429b1a0..e5bf8d8ef 100644 --- a/spec/presenters/hyku/menu_presenter_spec.rb +++ b/spec/presenters/hyku/menu_presenter_spec.rb @@ -11,7 +11,7 @@ subject { instance.repository_activity_section? } context "for the ContentBlocksController" do - let(:controller) { ContentBlocksController.new } + let(:controller) { Hyrax::ContentBlocksController.new } it { is_expected.to be false } end context "for the StatusController" do @@ -31,7 +31,7 @@ end subject { instance.settings_section? } context "for the ContentBlocksController" do - let(:controller) { ContentBlocksController.new } + let(:controller) { Hyrax::ContentBlocksController.new } it { is_expected.to be true } end context "for the Admin::GroupsController" do diff --git a/spec/routing/content_blocks_routing_spec.rb b/spec/routing/content_blocks_routing_spec.rb deleted file mode 100644 index 5e5a4d633..000000000 --- a/spec/routing/content_blocks_routing_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -RSpec.describe ContentBlocksController, type: :routing do - describe "routing" do - it "routes to #edit" do - expect(get: "/site/content_blocks/edit").to route_to("content_blocks#edit") - end - it "routes to #update via PUT" do - expect(put: "/site/content_blocks").to route_to("content_blocks#update") - end - - it "routes to #update via PATCH" do - expect(patch: "/site/content_blocks").to route_to("content_blocks#update") - end - end -end diff --git a/spec/services/iiif_thumbnail_path_service_spec.rb b/spec/services/iiif_thumbnail_path_service_spec.rb index d7224172f..f0eb8016c 100644 --- a/spec/services/iiif_thumbnail_path_service_spec.rb +++ b/spec/services/iiif_thumbnail_path_service_spec.rb @@ -7,6 +7,8 @@ before do allow(ActiveFedora::Base).to receive(:find).with('s1784k724').and_return(file_set) allow(file_set).to receive_messages(original_file: file, id: 's1784k724') + # https://github.com/projecthydra/active_fedora/issues/1251 + allow(file_set).to receive(:persisted?).and_return(true) end context "on a work" do diff --git a/spec/views/content_blocks/edit.html.erb_spec.rb b/spec/views/content_blocks/edit.html.erb_spec.rb deleted file mode 100644 index 0a6b80cc6..000000000 --- a/spec/views/content_blocks/edit.html.erb_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -RSpec.describe "content_blocks/edit", type: :view do - let(:site) { Site.create!(application_name: "MyString", institution_name: "My Inst Name") } - - before do - assign(:site, site) - end - - it "renders the edit site form" do - render - - assert_select "form[action=?][method=?]", site_content_blocks_path, "post" do - assert_select "textarea#site_announcement_text[name=?]", "site[announcement_text]" - assert_select "textarea#site_marketing_text[name=?]", "site[marketing_text]" - assert_select "textarea#site_featured_researcher[name=?]", "site[featured_researcher]" - assert_select "textarea#site_about_page[name=?]", "site[about_page]" - assert_select "textarea#site_help_page[name=?]", "site[help_page]" - end - end -end diff --git a/spec/views/hyrax/pages/show.html.erb_spec.rb b/spec/views/hyrax/pages/show.html.erb_spec.rb deleted file mode 100644 index 4a0887d9f..000000000 --- a/spec/views/hyrax/pages/show.html.erb_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -RSpec.describe "hyrax/pages/show", type: :view do - let(:page) { create(:content_block, name: 'about_page', value: 'This is the page.') } - - before do - assign(:page, page) - end - - it "renders the about_page content block" do - render - expect(rendered).to include(page.value) - expect(rendered).not_to include('tinymce') # Ensures hyrax's view with editor is not rendered. - end -end