Skip to content
Browse files

Done with static pages

  • Loading branch information...
1 parent 9d7e48b commit ac54f616c48f89e99a9bd5bd2601ec80a32cc032 @ggargiulo committed Nov 12, 2011
View
1 Gemfile
@@ -16,6 +16,7 @@ end
group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.1'
+ gem 'spork', '0.9.0.rc8'
end
View
11 Gemfile.lock
@@ -78,6 +78,8 @@ GEM
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
+ spork (0.9.0.rc8-x86-mingw32)
+ win32-process
sqlite3 (1.3.3-x86-mingw32)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@@ -90,13 +92,22 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
+ win32-api (1.4.8-x86-mingw32)
+ win32-process (0.6.5)
+ windows-pr (>= 1.1.2)
+ windows-api (0.4.0)
+ win32-api (>= 1.4.5)
+ windows-pr (1.2.1)
+ win32-api (>= 1.4.5)
+ windows-api (>= 0.3.0)
PLATFORMS
x86-mingw32
DEPENDENCIES
rails (= 3.0.9)
rspec-rails (= 2.6.1)
+ spork (= 0.9.0.rc8)
sqlite3 (= 1.3.3)
sqlite3-ruby
webrat (= 0.7.1)
View
8 app/controllers/pages_controller.rb
@@ -1,8 +1,16 @@
class PagesController < ApplicationController
+
def home
+ @title = "Home"
end
def contact
+ @title = "Contact"
+
+ end
+
+ def about
+ @title = "About"
end
end
View
24 app/views/layouts/application.html.erb
@@ -1,14 +1,10 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>DemoApp</title>
- <%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
- <%= csrf_meta_tag %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Ruby on Rails Tutorial Sample App | <%= @title %></title>
+ <%= csrf_meta_tag %>
+ </head>
+ <body>
+ <%= yield %>
+ </body>
+</html>
View
7 app/views/pages/about.html.erb
@@ -0,0 +1,7 @@
+<h1>About Us</h1>
+<p>
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ is a project to make a book and screencasts to teach web development
+ with <a href="http://rubyonrails.org/">Ruby on Rails</a>. This
+ is the sample application for the tutorial.
+</p>
View
8 app/views/pages/contact.html.erb
@@ -1,2 +1,6 @@
-<h1>Pages#contact</h1>
-<p>Find me in app/views/pages/contact.html.erb</p>
+<h1>Contact</h1>
+<p>
+ Contact Ruby on Rails Tutorial about the sample app at the
+ <a href="http://railstutorial.org/feedback">feedback page</a>.
+</p>
+
View
9 app/views/pages/home.html.erb
@@ -1,2 +1,7 @@
-<h1>Pages#home</h1>
-<p>Find me in app/views/pages/home.html.erb</p>
+<h1>Sample App</h1>
+<p>
+ This is the home page for the
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ sample application.
+</p>
+
View
16 bin/autospec
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'autospec' 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('rspec-core', 'autospec')
View
16 bin/erubis
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'erubis' 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('erubis', 'erubis')
View
16 bin/htmldiff
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'htmldiff' 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('diff-lcs', 'htmldiff')
View
16 bin/ldiff
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'ldiff' 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('diff-lcs', 'ldiff')
View
16 bin/nokogiri
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'nokogiri' 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('nokogiri', 'nokogiri')
View
16 bin/rackup
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rackup' 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('rack', 'rackup')
View
16 bin/rails
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rails' 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('rails', 'rails')
View
16 bin/rake
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rake' 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('rake', 'rake')
View
16 bin/rake2thor
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rake2thor' 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('thor', 'rake2thor')
View
16 bin/rdoc
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rdoc' 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('rdoc', 'rdoc')
View
16 bin/ri
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'ri' 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('rdoc', 'ri')
View
16 bin/rspec
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'rspec' 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('rspec-core', 'rspec')
View
16 bin/spork
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'spork' 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('spork', 'spork')
View
16 bin/sqlite3_ruby
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'sqlite3_ruby' 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('sqlite3-ruby', 'sqlite3_ruby')
View
16 bin/thor
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'thor' 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('thor', 'thor')
View
16 bin/tt
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'tt' 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('treetop', 'tt')
View
2 config/routes.rb
@@ -2,6 +2,8 @@
get "pages/home"
get "pages/contact"
+
+ get "pages/about"
resources :microposts
View
29 spec/controllers/pages_controller_spec.rb
@@ -1,19 +1,46 @@
require 'spec_helper'
describe PagesController do
-
+ render_views
+
describe "GET 'home'" do
it "should be successful" do
get 'home'
response.should be_success
end
+
+ it "should have the right title" do
+ get 'home'
+ response.should have_selector("title",:content => "Ruby on Rails Tutorial Sample App | Home")
+ end
end
describe "GET 'contact'" do
it "should be successful" do
get 'contact'
response.should be_success
end
+
+ it "should have the right title" do
+ get 'contact'
+ response.should have_selector("title", :content => "Ruby on Rails Tutorial Sample App | Contact")
+ end
+
+ end
+
+
+
+ describe "GET 'about'" do
+ it "should be successful" do
+ get 'about'
+ response.should be_success
+ end
+
+ it "should have the right title" do
+ get 'about'
+ response.should have_selector("title", :content => "Ruby on Rails Tutorial Sample App | About")
+ end
end
+
end
View
47 spec/spec_helper.rb
@@ -1,3 +1,50 @@
+require 'rubygems'
+require 'spork'
+
+Spork.prefork do
+ # Loading more in this block will cause your tests to run faster. However,
+ # if you change any configuration or code from libraries loaded here, you'll
+ # need to restart spork for it take effect.
+
+end
+
+Spork.each_run do
+ # This code will be run each time you run your specs.
+
+end
+
+# --- Instructions ---
+# Sort the contents of this file into a Spork.prefork and a Spork.each_run
+# block.
+#
+# The Spork.prefork block is run only once when the spork server is started.
+# You typically want to place most of your (slow) initializer code in here, in
+# particular, require'ing any 3rd-party gems that you don't normally modify
+# during development.
+#
+# The Spork.each_run block is run each time you run your specs. In case you
+# need to load files that tend to change during development, require them here.
+# With Rails, your application modules are loaded automatically, so sometimes
+# this block can remain empty.
+#
+# Note: You can modify files loaded *from* the Spork.each_run block without
+# restarting the spork server. However, this file itself will not be reloaded,
+# so if you change any of the code inside the each_run block, you still need to
+# restart the server. In general, if you have non-trivial code in this file,
+# it's advisable to move it into a separate file so you can easily edit it
+# without restarting spork. (For example, with RSpec, you could move
+# non-trivial code into a file spec/support/my_helper.rb, making sure that the
+# spec/support/* files are require'd from inside the each_run block.)
+#
+# Any code that is left outside the two blocks will be run during preforking
+# *and* during each_run -- that's probably not what you want.
+#
+# These instructions should self-destruct in 10 seconds. If they don't, feel
+# free to delete them.
+
+
+
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
View
5 spec/views/pages/contact.html.erb_spec.rb
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe "pages/contact.html.erb" do
- pending "add some examples to (or delete) #{__FILE__}"
-end
View
5 spec/views/pages/home.html.erb_spec.rb
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe "pages/home.html.erb" do
- pending "add some examples to (or delete) #{__FILE__}"
-end

0 comments on commit ac54f61

Please sign in to comment.
Something went wrong with that request. Please try again.