Skip to content

Commit

Permalink
Removes the copyright page's controller, route, and adds more tests.
Browse files Browse the repository at this point in the history
1. static_controller.rb: deletes the action for copyright.
2. routes.rb: extracts the associated route.
3. contact_spec.rb: to recoup a reduction in coverage, adds tests to check if
   new link is found on contacts page.
  • Loading branch information
bwatson78 committed Apr 22, 2020
1 parent 83c6435 commit e20d320
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 0 additions & 5 deletions app/controllers/static_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ def contact
render "static/contact"
end

# Accesses static copyright and reuse page: /copyright-reuse
def copyright_reuse
render "static/copyright_reuse"
end

def not_found
render status: 404
end
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
get "/uv/config/:id", to: "application#uv_config", as: "uv_config", defaults: { format: :json }
get "/contact", to: "static#contact"
get "/about", to: "static#about"
get "/copyright-reuse", to: "static#copyright_reuse"

match '/404', to: 'static#not_found', via: :all

Expand Down
21 changes: 17 additions & 4 deletions spec/requests/contact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@
require "rails_helper"

RSpec.describe "Contact page", type: :request do
it "loads the page without error" do
get "/contact"
before do
get '/contact'
end

it "loads the page without error" do
expect(response.status).to eq 200
expect(response.body).not_to be_empty
expect(response.content_length).to be > 0
expect(response.content_type).to eq "text/html"
end

it "contains the requested headers" do
get "/contact"

expect(response.body).to include 'Digital Repository Contacts'
expect(response.body).to include 'Send Feedback or Report a Problem'
expect(response.body).to include 'Digital Collections Contacts'
expect(response.body).to include 'Permissions / Reuse Questions'
end

it "contains the needed links" do
expect(response.body).to include 'feedback form'
expect(response.body).to include 'https://emory.libwizard.com/f/dlp-feedback'
expect(response.body).to include 'our wiki site'
expect(response.body).to include(
'https://wiki.service.emory.edu/display/DLPP/Emory+Digital+Collections+User+Guide'
)
expect(response.body).to include 'rose.library@emory.edu'
expect(response.body).to include 'mailto:rose.library@emory.edu'
expect(response.body).to include 'oxarchives@listserv.cc.emory.edu'
expect(response.body).to include 'mailto:oxarchives@listserv.cc.emory.edu'
end
end

0 comments on commit e20d320

Please sign in to comment.