Skip to content

Commit

Permalink
Static pages extras
Browse files Browse the repository at this point in the history
  • Loading branch information
paullang committed Feb 23, 2012
1 parent a6dafb6 commit ea3fbff
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -38,5 +38,9 @@ group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.1'
gem 'spork', '0.9.0.rc8'
gem 'autotest', '4.4.6'
gem 'autotest-rails-pure', '4.1.2'
gem 'autotest-fsevent', '0.2.4'
gem 'autotest-growl', '0.2.16'
end

14 changes: 14 additions & 0 deletions Gemfile.lock
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
ZenTest (4.6.2)
abstract (1.0.0)
actionmailer (3.0.11)
actionpack (= 3.0.11)
Expand Down Expand Up @@ -29,10 +30,17 @@ GEM
activesupport (= 3.0.11)
activesupport (3.0.11)
arel (2.0.10)
autotest (4.4.6)
ZenTest (>= 4.4.1)
autotest-fsevent (0.2.4)
sys-uname
autotest-growl (0.2.16)
autotest-rails-pure (4.1.2)
builder (2.1.2)
diff-lcs (1.1.3)
erubis (2.6.6)
abstract (>= 1.0.0)
ffi (1.0.11)
i18n (0.5.0)
json (1.6.5)
mail (2.2.19)
Expand Down Expand Up @@ -80,6 +88,8 @@ GEM
rspec (~> 2.6.0)
spork (0.9.0.rc8)
sqlite3 (1.3.5)
sys-uname (0.9.0)
ffi (>= 1.0.0)
thor (0.14.6)
treetop (1.4.10)
polyglot
Expand All @@ -94,6 +104,10 @@ PLATFORMS
ruby

DEPENDENCIES
autotest (= 4.4.6)
autotest-fsevent (= 0.2.4)
autotest-growl (= 0.2.16)
autotest-rails-pure (= 4.1.2)
rails (= 3.0.11)
rspec-rails (= 2.6.1)
spork (= 0.9.0.rc8)
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/pages_controller.rb
Expand Up @@ -11,4 +11,8 @@ def about
@title="About"
end

def help
@title="Help"
end

end
7 changes: 7 additions & 0 deletions app/views/pages/help.html.erb
@@ -0,0 +1,7 @@
<h1>Help</h1>
<p>
Get help on Ruby on Rails Tutorial at the
<a href="http://railstutorial.org/help">Rails Tutorial help page</a>.
To get help on this sample app, see the
<a href="http://railstutorial.org/book">Rails Tutorial book</a>.
</p>
16 changes: 16 additions & 0 deletions bin/autotest
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'autotest' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'autotest')
16 changes: 16 additions & 0 deletions bin/multigem
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'multigem' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'multigem')
16 changes: 16 additions & 0 deletions bin/multiruby
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'multiruby' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'multiruby')
16 changes: 16 additions & 0 deletions bin/multiruby_setup
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'multiruby_setup' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'multiruby_setup')
16 changes: 16 additions & 0 deletions bin/unit_diff
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'unit_diff' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'unit_diff')
16 changes: 16 additions & 0 deletions bin/zentest
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'zentest' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('ZenTest', 'zentest')
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -2,6 +2,7 @@
get "pages/home"
get "pages/contact"
get "pages/about"
get "pages/help"

# The priority is based upon order of creation:
# first created -> highest priority.
Expand Down
22 changes: 19 additions & 3 deletions spec/controllers/pages_controller_spec.rb
Expand Up @@ -3,6 +3,10 @@
describe PagesController do
render_views

before(:each) do
@base_title = "Ruby on Rails Tutorial Sample App"
end

describe "GET 'home'" do
it "should be successful" do
get 'home'
Expand All @@ -12,7 +16,7 @@
it "should have the right title" do
get 'home'
response.should have_selector("title",
:content => "Ruby on Rails Tutorial Sample App | Home")
:content => @base_title + " | Home")
end
end

Expand All @@ -24,7 +28,7 @@
it "should have the right title" do
get 'contact'
response.should have_selector("title",
:content => "Ruby on Rails Tutorial Sample App | Contact")
:content => @base_title + " | Contact")
end
end

Expand All @@ -36,7 +40,19 @@
it "should have the right title" do
get 'about'
response.should have_selector("title",
:content => "Ruby on Rails Tutorial Sample App | About")
:content => @base_title + " | About")
end
end

describe "GET 'help'" do
it "should be successful" do
get 'help'
response.should be_success
end
it "should have the right title" do
get 'help'
response.should have_selector("title",
:content => @base_title + " | Help")
end
end

Expand Down

0 comments on commit ea3fbff

Please sign in to comment.