spec/features/feature_page_spec.rb in blacklight-spotlight-1.0.0 vs spec/features/feature_page_spec.rb in blacklight-spotlight-1.1.0
- old
+ new
@@ -1,12 +1,12 @@
-describe 'Feature page', type: :feature do
- let(:exhibit) { FactoryGirl.create(:exhibit) }
- let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
+describe 'Feature page', type: :feature, versioning: true do
+ let(:exhibit) { FactoryBot.create(:exhibit) }
+ let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
describe 'viewing the page' do
let!(:feature_page) do
- FactoryGirl.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
+ FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
end
it 'has <meta> tags' do
TopHat.current['twitter_card'] = nil
TopHat.current['opengraph'] = nil
@@ -19,14 +19,14 @@
end
end
describe 'sidebar' do
let!(:parent_feature_page) do
- FactoryGirl.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
+ FactoryBot.create(:feature_page, title: 'Parent Page', exhibit: exhibit)
end
let!(:child_feature_page) do
- FactoryGirl.create(
+ FactoryBot.create(
:feature_page,
title: 'Child Page',
parent_page: parent_feature_page, exhibit: exhibit
)
end
@@ -69,11 +69,11 @@
end
end
describe 'page options' do
before { login_as exhibit_curator }
describe 'publish' do
- let!(:unpublished_page) { FactoryGirl.create(:feature_page, published: false, exhibit: exhibit) }
+ let!(:unpublished_page) { FactoryBot.create(:feature_page, published: false, exhibit: exhibit) }
it 'is updatable from the edit page' do
expect(unpublished_page).not_to be_published
visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page)
expect(find('#feature_page_published')).not_to be_checked
@@ -86,11 +86,11 @@
visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page)
expect(find('#feature_page_published')).to be_checked
end
end
describe 'display_sidebar' do
- let!(:feature_page) { FactoryGirl.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
+ let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
before { feature_page.update display_sidebar: false }
it 'is updatable from the edit page' do
expect(feature_page.display_sidebar?).to be_falsey
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)
@@ -107,10 +107,10 @@
end
end
describe 'page locking' do
before { login_as exhibit_curator }
- let!(:feature_page) { FactoryGirl.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
+ let!(:feature_page) { FactoryBot.create(:feature_page, display_sidebar: false, exhibit: exhibit) }
it 'shows a lock message if someone is currently editing the page' do
# open the edit page
visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page)