-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into master-legacy
- Loading branch information
Showing
8 changed files
with
114 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<article class="post-item"> | ||
<h3 class="title"> | ||
<% if blog_entry.full_path.present? %> | ||
<%= link_to(fragment_title(blog_entry), "/cms#{blog_entry.full_path}") %> | ||
<%= link_to(cms_fragment_content('title', blog_entry), "/cms#{blog_entry.full_path}") %> | ||
<% end %> | ||
</h3> | ||
<%= render 'blog_entries/comfy_metadata', blog_entry: blog_entry %> | ||
<a class="snippet" href="<%= blog_entry.full_path %>"> | ||
<%= raw fragment_abstract(blog_entry) %> | ||
<%= raw cms_fragment_content('abstract', blog_entry) %> | ||
</a> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% title cms_fragment_content('page_title', @cms_page) %> | ||
|
||
<div class="high_voltage-pages"> | ||
<section class="main"> | ||
<div class="main-inner"> | ||
<%= raw cms_fragment_content('page_content', @cms_page) %> | ||
</div> | ||
</section> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'rails_helper' | ||
require 'uri' | ||
|
||
describe 'lumen:migrate_original_news_id_redirects', type: :request do | ||
before(:all) do | ||
expect(BlogEntry.count).to eq 0 | ||
create( | ||
:blog_entry, | ||
author: 'John Rock', | ||
title: 'Speech at Faneuil Hall', | ||
abstract: 'abstract goes here', | ||
image: 'overcast', | ||
content: 'content goes here', | ||
original_news_id: 1 | ||
) | ||
Rake::Task['lumen:set_up_cms'].execute | ||
Rake::Task['lumen:migrate_blog_entries_to_cms'].execute | ||
Rake::Task['lumen:migrate_original_news_id_redirects'].execute | ||
end | ||
|
||
after(:all) do | ||
BlogEntry.destroy_all | ||
end | ||
|
||
it 'creates redirects for original news IDs' do | ||
get '/original_news_id/1' | ||
original_path = URI::parse(response.location).path | ||
|
||
page = Comfy::Cms::Page.find_by_full_path('/original_news_id/1') | ||
expect(page.target_page).to be_present | ||
|
||
# The full URL will not be the same because of namespacing under the CMS. | ||
# This is good -- it means we're not inadvertently testing our existing | ||
# controller. But the Comfy::Cms::Page.full_path attribute does not include | ||
# the namespacing. | ||
expect(page.target_page.full_path).to eq original_path | ||
end | ||
end |