Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: vigneshinfoavc/sample_apps
base: f2da53e062
...
head fork: vigneshinfoavc/sample_apps
compare: 9eea0d9eae
  • 2 commits
  • 12 files changed
  • 0 commit comments
  • 1 contributor
Commits on Oct 16, 2012
vignesh second commit 2df3e84
Commits on Oct 24, 2012
vignesh add layout to the site 9eea0d9
4 Gemfile
View
@@ -2,12 +2,16 @@ source 'http://rubygems.org'
gem 'rails', '3.0.0'
+gem 'spork-rails'
+
gem 'pg'
group :development do
gem 'rspec-rails', '2.0.0.beta.18'
+ gem 'autotest'
end
group :test do
gem 'rspec','2.0.0.beta.18'
+ gem 'autotest'
end
9 Gemfile.lock
View
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
+ ZenTest (4.8.2)
abstract (1.0.0)
actionmailer (3.0.0)
actionpack (= 3.0.0)
@@ -30,6 +31,8 @@ GEM
activesupport (3.0.0)
arel (1.0.1)
activesupport (~> 3.0.0)
+ autotest (4.4.6)
+ ZenTest (>= 4.4.1)
builder (2.1.2)
diff-lcs (1.1.3)
erubis (2.6.6)
@@ -74,6 +77,10 @@ GEM
rspec-rails (2.0.0.beta.18)
rspec (>= 2.0.0.beta.14)
webrat (>= 0.7.0)
+ spork (1.0.0rc3)
+ spork-rails (3.2.0)
+ rails (< 3.3.0, >= 3.0.0)
+ spork (>= 1.0rc0)
thor (0.14.6)
treetop (1.4.11)
polyglot
@@ -88,7 +95,9 @@ PLATFORMS
ruby
DEPENDENCIES
+ autotest
pg
rails (= 3.0.0)
rspec (= 2.0.0.beta.18)
rspec-rails (= 2.0.0.beta.18)
+ spork-rails
14 app/controllers/pages_controller.rb
View
@@ -0,0 +1,14 @@
+class PagesController < ApplicationController
+ def home
+ @title = "Home"
+ end
+
+ def contact
+ @title = "Contact"
+ end
+
+ def about
+ @title = "About"
+ end
+
+end
2  app/helpers/pages_helper.rb
View
@@ -0,0 +1,2 @@
+module PagesHelper
+end
10 app/views/layouts/application.html.erb
View
@@ -1,14 +1,10 @@
-<!DOCTYPE html>
+<!DOCTYPE>
<html>
<head>
- <title>SampApp</title>
- <%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
- <%= csrf_meta_tag %>
+<title>Ruby on Rails Sample Application | <%=@title%></title>
+<%= csrf_meta_tag %>
</head>
<body>
-
<%= yield %>
-
</body>
</html>
2  app/views/pages/about.html.erb
View
@@ -0,0 +1,2 @@
+<h1>About Us</h1>
+<p>This is the basic details of ROR</p>
4 app/views/pages/contact.html.erb
View
@@ -0,0 +1,4 @@
+<h1>Contact</h1>
+<p>
+ <a href ="www.railsfactory.org">This is the Ruby on Rails Application If any details contact in this page</a>
+</p>
3  app/views/pages/home.html.erb
View
@@ -0,0 +1,3 @@
+<h1>Home</h1>
+<p>Ruby on Rails Sample Application the Home page</p>
+
28 config/database.yml
View
@@ -1,22 +1,26 @@
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
+ adapter: postgresql
+ database: sampleapps
+ username: postgres
+ password: postgres
+ host: localhost
+ port: 5432
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
+ adapter: postgresql
+ database: sampleappstest
+ username: postgres
+ password: postgres
+ host: localhost
+ port: 5432
production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
+ #adapter: sqlite3
+ #database: db/production.sqlite3
+ #pool: 5
+ #timeout: 5000
6 config/routes.rb
View
@@ -1,4 +1,10 @@
SampApp::Application.routes.draw do
+ get "pages/home"
+
+ get "pages/contact"
+
+ get "pages/about"
+
# The priority is based upon order of creation:
# first created -> highest priority.
44 spec/controllers/pages_controller_spec.rb
View
@@ -0,0 +1,44 @@
+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 right title" do
+ get 'home'
+ response.should have_selector("title",:content => "Ruby on Rails Sample Application | Home")
+ end
+
+ it "should have non blank" do
+ get 'home'
+ response.body.should_not =~ /<body>\s*<\/body>/
+ end
+ end
+
+ describe "GET 'contact'" do
+ it "should be successful" do
+ get 'contact'
+ response.should be_success
+ end
+ it "should have right title" do
+ get 'contact'
+ response.should have_selector("title", :content => "Ruby on Rails Sample Application | Contact")
+ end
+ end
+
+ describe "GET 'about'" do
+ it "should be successful" do
+ get 'about'
+ response.should be_success
+ end
+ it "should have right title" do
+ get 'about'
+ response.should have_selector("title", :content => "Ruby on Rails Sample Application | About")
+ end
+ end
+
+end
3  spec/spec_helper.rb
View
@@ -1,5 +1,8 @@
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
+require 'spork'
+require 'rspec'
+require 'rubygems'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

No commit comments for this range

Something went wrong with that request. Please try again.