Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test written and passed

  • Loading branch information...
commit a9983454212761532a782541f786a8e085646501 1 parent 03d2dbb
@safalmj authored
View
4 Gemfile
@@ -26,6 +26,10 @@ end
gem 'jquery-rails'
+group :test do
+ gem 'capybara', '1.1.2'
+end
+
group :production do
gem 'pg', '0.12.2'
end
View
23 Gemfile.lock
@@ -28,8 +28,18 @@ GEM
activesupport (3.2.6)
i18n (~> 0.6)
multi_json (~> 1.0)
+ addressable (2.2.8)
arel (3.0.2)
builder (3.0.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.3.3)
+ ffi (~> 1.0.6)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
@@ -41,6 +51,7 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ ffi (1.0.11)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
@@ -48,12 +59,15 @@ GEM
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.7.4)
+ libwebsocket (0.1.4)
+ addressable
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.6)
+ nokogiri (1.5.5)
pg (0.12.2)
polyglot (0.3.3)
rack (1.4.1)
@@ -94,11 +108,17 @@ GEM
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.10.0)
+ rubyzip (0.9.9)
sass (3.1.20)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
+ selenium-webdriver (2.25.0)
+ childprocess (>= 0.2.5)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -113,11 +133,14 @@ GEM
uglifier (1.2.7)
execjs (>= 0.3.0)
multi_json (~> 1.3)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
+ capybara (= 1.1.2)
coffee-rails (~> 3.2.1)
jquery-rails
json
View
3  app/controllers/static_pages_controller.rb
@@ -4,4 +4,7 @@ def home
def help
end
+
+ def about
+ end
end
View
1  app/views/static_pages/about.html.erb
@@ -0,0 +1 @@
+<h1>About Us</h1>
View
2  app/views/static_pages/help.html.erb
@@ -1,2 +1,2 @@
-<h1>StaticPages#help</h1>
+<h1>Help</h1>
<p>Find me in app/views/static_pages/help.html.erb</p>
View
8 app/views/static_pages/home.html.erb
@@ -1,2 +1,6 @@
-<h1>StaticPages#home</h1>
-<p>Find me in app/views/static_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
1  config/routes.rb
@@ -2,6 +2,7 @@
get "static_pages/home"
get "static_pages/help"
+ get "/static_pages/about"
# The priority is based upon order of creation:
# first created -> highest priority.
View
25 spec/requests/static_pages_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe "StaticPages" do
+
+ describe "Home page" do
+ it "should have the content 'Sample App'" do
+ visit '/static_pages/home'
+ page.should have_content('Sample App')
+ end
+ end
+
+ describe "Help page" do
+ it "should have the content 'Help'" do
+ visit '/static_pages/help'
+ page.should have_content('Help')
+ end
+ end
+
+ describe "About Us" do
+ it "should have the content 'About us'" do
+ visit "/static_pages/about"
+ page.should have_content('About Us')
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.