summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-19 10:30:41 -0600
committermo khan <mo@mokhan.ca>2013-07-19 10:30:41 -0600
commit7a0d959332d84b31bfc1b35679a0a86cbd8e81e4 (patch)
tree6efd776ddbe6828a913b57b8133006240657ddc0
parent9f625d61d21a1b372d768f0c25e40ec07983a503 (diff)
add sample capybara spec and fluff route
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock1
-rw-r--r--app/controllers/welcome_controller.rb4
-rw-r--r--app/views/layouts/application.html.erb3
-rw-r--r--app/views/welcome/index.html.erb1
-rw-r--r--config/routes.rb2
-rw-r--r--spec/features/home_spec.rb8
-rw-r--r--spec/spec_helper.rb2
8 files changed, 21 insertions, 1 deletions
diff --git a/Gemfile b/Gemfile
index c26ea32..d2921fb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -35,6 +35,7 @@ end
group :development, :test do
gem 'rspec-rails'
gem 'teaspoon'
+ gem 'capybara'
end
# Use ActiveModel has_secure_password
diff --git a/Gemfile.lock b/Gemfile.lock
index efc5a7c..e2c6528 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -148,6 +148,7 @@ PLATFORMS
DEPENDENCIES
bootstrap-sass
+ capybara
coffee-rails (~> 4.0.0)
jbuilder (~> 1.2)
jquery-rails
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
new file mode 100644
index 0000000..f9b859b
--- /dev/null
+++ b/app/controllers/welcome_controller.rb
@@ -0,0 +1,4 @@
+class WelcomeController < ApplicationController
+ def index
+ end
+end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index d8ed28c..91b6c2e 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -10,6 +10,9 @@
<%= csrf_meta_tags %>
</head>
<body>
+ <div class="container">
+ <%= yield %>
+ </div>
<%= javascript_include_tag :application %>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
new file mode 100644
index 0000000..6493247
--- /dev/null
+++ b/app/views/welcome/index.html.erb
@@ -0,0 +1 @@
+<h1>Hello Ruby Universe!</h1>
diff --git a/config/routes.rb b/config/routes.rb
index aae74aa..3344067 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,7 +3,7 @@ Parley::Application.routes.draw do
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
- # root 'welcome#index'
+ root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb
new file mode 100644
index 0000000..7d1710b
--- /dev/null
+++ b/spec/features/home_spec.rb
@@ -0,0 +1,8 @@
+require "spec_helper"
+
+describe "home" do
+ it "should display the default home page" do
+ visit '/'
+ expect(page).to have_content "Hello Ruby Universe!"
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 943bc19..f5032ad 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,6 +3,8 @@ ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
+require 'capybara/rails'
+require 'capybara/rspec'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.