-
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.
- Loading branch information
Showing
10 changed files
with
169 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
load File.expand_path("spring", __dir__) | ||
require 'bundler/setup' | ||
load Gem.bin_path('rspec-core', 'rspec') |
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 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This file loads Spring without loading other gems in the Gemfile in order to be fast. | ||
# It gets overwritten when you run the `spring binstub` command. | ||
|
||
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) | ||
require "bundler" | ||
|
||
Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring| | ||
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path | ||
gem "spring", spring.version | ||
require "spring/binstub" | ||
end | ||
end |
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,4 +1,7 @@ | ||
FactoryBot.define do | ||
factory :book do | ||
end | ||
|
||
factory :faq do | ||
end | ||
end |
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,8 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Faq', type: :request do | ||
# describe '#show' do | ||
# let!(:faq) { create(:faq) } | ||
# let(:get_url) { "http://localhost:3000/faq" } | ||
# end | ||
end |
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,117 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Home', type: :request do | ||
describe '#index' do | ||
let(:get_url) { "http://localhost:3000" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#mln_file_names' do | ||
let(:get_url) { "http://localhost:3000/home/get_mln_file_names" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#swagger_docs' do | ||
let(:get_url) { "http://localhost:3000/docs/mylibrarynyc" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#digital_resources' do | ||
let(:get_url) { "http://localhost:3000/help/access-digital-resources" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#help' do | ||
let(:get_url) { "http://localhost:3000/contact" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#faq_data' do | ||
let(:get_url) { "http://localhost:3000/faq" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#newsletter_confirmation' do | ||
let(:get_url) { "http://localhost:3000/newsletter_confirmation" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#newsletter_confirmation_msg' do | ||
let(:get_url) { "http://localhost:3000/home/newsletter_confirmation_msg" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#calendar_event' do | ||
let(:get_url) { "http://localhost:3000/home/calendar_event" } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#mln_calendar' do | ||
let(:get_url) { "http://localhost:3000/home/calendar_event/#{filename}" } | ||
let(:filename) { 'some_filename.pdf' } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe '#menu_of_services' do | ||
let(:get_url) { "http://localhost:3000/menu_of_services/#{filename}" } | ||
|
||
context 'filename is menu_of_services.pdf' do | ||
let(:filename) { 'menu_of_services.pdf' } | ||
|
||
it 'gets successfully' do | ||
get get_url | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
context 'filename is something else' do | ||
let(:filename) { 'something_else.pdf' } | ||
|
||
it 'redirects' do | ||
get get_url | ||
expect(response.response_code).to eq(302) | ||
end | ||
end | ||
end | ||
|
||
end |