forked from zassmin/TicTacToeSkeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix capybara/rspec error for method visit, new gemfile and testing fo…
…lder for views changed to requests now
- Loading branch information
Showing
12 changed files
with
166 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--colour | ||
--color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rails', '3.2.11' | ||
gem 'sqlite3' | ||
gem 'jquery-rails' | ||
gem 'rails', '3.2.13' | ||
gem 'bootstrap-sass', '2.1' | ||
|
||
group :development, :test do | ||
gem 'sqlite3', '1.3.5' | ||
gem 'rspec-rails', '2.11.0' | ||
end | ||
|
||
# Gems used only for assets and not required | ||
# in production environments by default. | ||
group :assets do | ||
gem 'sass-rails', '~> 3.2.3' | ||
gem 'coffee-rails', '~> 3.2.1' | ||
gem 'uglifier', '>= 1.0.3' | ||
gem 'sass-rails', '3.2.5' | ||
gem 'coffee-rails', '3.2.2' | ||
gem 'uglifier', '1.2.3' | ||
end | ||
|
||
gem 'jquery-rails', '2.0.2' | ||
|
||
group :test do | ||
gem 'cucumber-rails', :require => false | ||
gem 'database_cleaner' | ||
gem 'rspec-rails' | ||
gem 'capybara', '1.1.2' | ||
end | ||
|
||
group :assets do | ||
gem 'bootstrap-sass-rails' | ||
end | ||
|
||
# To use ActiveModel has_secure_password | ||
# gem 'bcrypt-ruby', '~> 3.0.0' | ||
|
||
# To use Jbuilder templates for JSON | ||
# gem 'jbuilder' | ||
|
||
# Use unicorn as the app server | ||
# gem 'unicorn' | ||
|
||
# Deploy with Capistrano | ||
# gem 'capistrano' | ||
|
||
# To use debugger | ||
# gem 'debugger' | ||
group :production do | ||
gem 'pg', '0.12.2' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
module ApplicationHelper | ||
end | ||
|
||
# Returns the full title on a per-page basis. | ||
def full_title(page_title) | ||
base_title = "TicTacToe" | ||
if page_title.empty? | ||
base_title | ||
else | ||
"#{base_title} | #{page_title}" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<br/> | ||
<br/> | ||
<h1>TicTacToe is coming soon!</h1> | ||
<div class="center hero-unit"> | ||
<h1>TicTacToe is coming soon!</h1> | ||
<%= link_to "Start Game!", new_path, class: "btn btn-large primary" %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<% provide(:title, 'Play Game') %> | ||
<br/> | ||
<br/> | ||
<h1>New Game set-up is coming soon!</h1> | ||
<h1>Play Game</h1> | ||
<p>it's coming soon!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
require 'application_helper' | ||
|
||
describe 'ApplicationHelper' do | ||
|
||
describe 'full_title' do | ||
it 'should include the page title' do | ||
full_title('foo').should =~ /foo/ | ||
end | ||
|
||
it 'should include the base title' do | ||
full_title('foo').should =~ /^TicTacToe/ | ||
end | ||
|
||
it 'should not include a bar for the home page' do | ||
full_title('').should_not =~ /\|/ | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'spec_helper' | ||
|
||
describe "Games" do | ||
|
||
subject { page } | ||
|
||
shared_examples_for "all games pages" do | ||
it { should have_selector('h1', text: heading) } | ||
it { should have_selector('title', text: full_title(page_title)) } | ||
end | ||
|
||
# doesn't like visit - it's a capybara thing | ||
describe "Index page" do | ||
before { visit root_path } | ||
|
||
let(:heading) { 'TicTacToe' } | ||
let(:page_title) { '' } | ||
|
||
it_should_behave_like "all games pages" | ||
end | ||
|
||
describe "New page" do | ||
before { visit new_path } | ||
|
||
let(:heading) { 'Play Game' } | ||
let(:page_title) { '' } | ||
|
||
it_should_behave_like "all games pages" | ||
end | ||
end |
Oops, something went wrong.