-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #389 from srogers/develop
Release v096
- Loading branch information
Showing
12 changed files
with
92 additions
and
19 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
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,14 @@ | ||
= render partial: 'menu' | ||
- title 'Terms of Service' | ||
|
||
.row | ||
.col-md-12 | ||
= safe_list_sanitizer.sanitize(@terms_of_service&.content).try(:html_safe) | ||
|
||
.row.mt-4 | ||
.col-md-12 | ||
%p | ||
Version | ||
= [@terms_of_service&.version, ','].join | ||
Last updated | ||
= pretty_date(@terms_of_service&.updated_at) |
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,12 +1,14 @@ | ||
.row.mb-2 | ||
.col | ||
.col-md-2 | ||
= sorting_header 'Name', :passages_path, 'passages.name' | ||
.col-md-2.text-right | ||
Version | ||
.col | ||
= sorting_header 'View', :passages_path, 'passages.view' | ||
.col | ||
= sorting_header 'Instance Var', :passages_path, 'passages.assign_var' | ||
|
||
|
||
- if can? :edit, Passage | ||
.col | ||
.col-md-3.text-right | ||
|
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,4 @@ | ||
# This ensures there is an entry in Passages for the Privacy Policy and Terms of Service, even if they are just blank, | ||
# so that the Name and details are locked in. | ||
Passage.ensure_privacy_policy | ||
Passage.ensure_terms_of_service |
This file was deleted.
Oops, something went wrong.
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,23 +1,52 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe PassagesController, type: :controller do | ||
RSpec.describe PagesController, type: :controller do | ||
fixtures :roles | ||
setup :activate_authlogic | ||
|
||
let(:user) { create :user } | ||
|
||
before do | ||
@current_user = user | ||
log_in @current_user | ||
describe "GET #privacy_policy" do | ||
|
||
let!(:passage) { create :passage, Passage::PRIVACY_POLICY.merge(creator: user) } | ||
|
||
it "finds the passage by controller/action and assigns it as @passage" do | ||
get :privacy_policy | ||
expect(assigns(:privacy_policy).name).to eq('Privacy Policy') | ||
end | ||
|
||
context "with authenticated user" do | ||
before do | ||
@current_user = user | ||
log_in @current_user | ||
end | ||
|
||
it "finds the passage by controller/action and assigns it as @passage" do | ||
get :privacy_policy | ||
expect(assigns(:privacy_policy).name).to eq('Privacy Policy') | ||
end | ||
end | ||
end | ||
|
||
describe "GET #privacy_policy" do | ||
describe "GET #terms_of_service" do | ||
|
||
let!(:passage) { create :passage, Passage::TERMS_OF_SERVICE.merge(creator: user) } | ||
|
||
it "finds the passage by controller/action and assigns it as @passage" do | ||
get :terms_of_service | ||
expect(assigns(:terms_of_service).name).to eq('Terms of Service') | ||
end | ||
|
||
let!(:passage) { create :passage } | ||
context "with authenticated user" do | ||
before do | ||
@current_user = user | ||
log_in @current_user | ||
end | ||
|
||
it "assigns the requested passage as @passage" do | ||
get :show, params: {id: passage.to_param} | ||
expect(assigns(:passage)).to eq(passage) | ||
it "finds the passage by controller/action and assigns it as @passage" do | ||
get :terms_of_service | ||
expect(assigns(:terms_of_service).name).to eq('Terms of Service') | ||
end | ||
end | ||
end | ||
end |