Skip to content

Commit

Permalink
Add RSpec, Capybara & Poltergeist
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sabin committed Nov 22, 2014
1 parent 2b16a7c commit ef2409e
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ gem 'turbolinks'
gem 'rails_config'

group :development, :test do
gem 'rspec-rails', '~> 3.0'
gem 'pry'
end

group :development do
gem 'spring'
end

group :test do
gem 'capybara'
gem 'poltergeist'
end

ruby '2.1.5'
38 changes: 38 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ GEM
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
builder (3.2.2)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
cliver (0.3.2)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
Expand All @@ -37,6 +44,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.8.0)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.2.2)
hike (1.2.3)
Expand All @@ -49,9 +57,17 @@ GEM
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (2.4.3)
mini_portile (0.6.1)
minitest (5.4.3)
multi_json (1.10.1)
nokogiri (1.6.4.1)
mini_portile (~> 0.6.0)
pg (0.17.1)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
Expand All @@ -77,6 +93,22 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
sass (3.2.19)
sass-rails (4.0.4)
railties (>= 4.0.0, < 5.0)
Expand Down Expand Up @@ -104,16 +136,22 @@ GEM
uglifier (2.5.3)
execjs (>= 0.3.0)
json (>= 1.8.0)
websocket-driver (0.4.0)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
capybara
jquery-rails
pg
poltergeist
pry
rails (= 4.1.8)
rails_config
rspec-rails (~> 3.0)
sass-rails (~> 4.0.3)
spring
turbolinks
Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
config.action_controller.allow_forgery_protection = false
config.action_mailer.delivery_method = :test
config.active_support.deprecation = :stderr
config.allow_concurrency = false
end
12 changes: 12 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
end
13 changes: 13 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist

RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end

config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
end

0 comments on commit ef2409e

Please sign in to comment.