File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ class EmoryLibrariesFooterGenerator < Rails ::Generators ::Base
2+ desc "this generator copies over everything you need to get started"
3+ source_root File . expand_path ( "../../templates" , __dir__ )
4+
5+ # giving them a links file
6+ def write_links_file
7+ # where to look for it?
8+ host_file = File . join ( destination_root , "app/views/railsfooter/_footer_links.html.erb" )
9+
10+ # IF they don't already have the links file, copy over a blank one.
11+ if File . exist? ( host_file )
12+ puts "awesome, you already have your links file"
13+ else
14+ copy_file "_footer_links.html.erb" , "app/views/railsfooter/_footer_links.html.erb"
15+ end
16+ end
17+
18+ # giving them a lovely test for their test suite
19+ def write_spec_file
20+ # copy over a test file. will use copy_file? to write/overwrite an existing test file. can instruct to rename the test if they edit?
21+ copy_file "footer_gem_test_spec.rb" , "spec/features/footer_gem_test_spec.rb"
22+ end
23+ end
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
2323 end
2424
2525 spec . add_dependency "rails" , ">= 5.0"
26+ spec . executables = [ "railsfooter_setup" ]
2627end
File renamed without changes.
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'rails_helper'
4+
5+ RSpec . describe "visit page, there's a footer" , type : :feature do
6+ # is the footer placed?
7+ it 'has a footer' do
8+ visit root_path
9+ expect ( page ) . to have_selector ( "#emory-footer" )
10+ end
11+
12+ # and are the links in place?
13+ it 'footer has links' do
14+ visit root_path
15+ expect ( page ) . to have_selector ( ".footer-list" )
16+ end
17+
18+ # can haz selenium test?
19+ # are the styles applied?
20+ it 'footer is emory blue' , js : true do
21+ visit root_path
22+ expect ( page . find ( '#emory-footer footer' ) ) . to match_style ( 'background-color' => 'rgb(9, 28, 68)' )
23+ end
24+ end
25+
26+ # test that the version line is pulling variables
27+ RSpec . describe "version is displaying correctly" , type : :feature do
28+ it "shows the version information in the footer" do
29+ stub_const ( "BRANCH" , "branchy-mcversionface" )
30+ stub_const ( "LAST_DEPLOYED" , "when it is a damp drizzly november in my soul" )
31+
32+ visit root_path
33+ expect ( page . find ( '#emory-footer' ) ) . to have_content ( "Version branchy-mcversionface updated when it is a damp drizzly november in my soul" )
34+ end
35+ end
You can’t perform that action at this time.
0 commit comments