Skip to content

Commit

Permalink
Upgraded capybara and renamed spec/acceptance to spec/features as per…
Browse files Browse the repository at this point in the history
… Capybara 2 defaults. Fixed accounts_spec. More to follow.
  • Loading branch information
steveyken committed Mar 21, 2013
1 parent 1f7522c commit 9f4fcb8
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 80 deletions.
24 changes: 7 additions & 17 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ source 'https://rubygems.org'

# Uncomment the database that you have configured in config/database.yml
# ----------------------------------------------------------------------
# gem 'mysql2', '0.3.10'
# gem 'mysql2'
# gem 'sqlite3'
gem 'pg', '~> 0.13.2'
gem 'pg'

# Allows easy switching between locally developed gems, and gems installed from rubygems.org
# See README for more info at: https://github.com/ndbroadbent/bundler_local_development
Expand Down Expand Up @@ -51,23 +51,15 @@ end
group :development, :test do
gem 'rspec-rails'
gem 'headless'
unless ENV["CI"]
gem 'ruby-debug', :platform => :mri_18
gem 'debugger', :platform => :mri_19
end
gem 'debugger' unless ENV["CI"]
gem 'pry-rails'
end

group :test do
gem 'capybara', '~> 1.1' # v2 and up is not r1.8 compatible.
gem 'capybara'
gem 'database_cleaner'
gem "acts_as_fu", "~> 0.0.8"

if RUBY_VERSION.to_f >= 1.9
gem 'factory_girl_rails', '~> 3.0.0'
else
gem 'factory_girl_rails', '~> 1.7.0'
end
gem "acts_as_fu"
gem 'factory_girl_rails'
end

group :heroku do
Expand All @@ -82,9 +74,7 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'execjs'
unless ENV["CI"]
gem 'therubyracer', :platform => :ruby
end
gem 'therubyracer', :platform => :ruby unless ENV["CI"]
end

gem 'turbo-sprockets-rails3'
63 changes: 25 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ GEM
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capistrano_colors (0.5.5)
capybara (1.1.4)
capybara (2.0.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.6)
ffi (~> 1.0, >= 1.0.6)
xpath (~> 1.0.0)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
chosen-rails_ffcrm (0.9.5)
railties (~> 3.0)
thor (~> 0.14)
Expand All @@ -81,28 +81,27 @@ GEM
css_parser (1.3.4)
addressable
daemons (1.1.9)
database_cleaner (0.7.2)
debugger (1.3.0)
database_cleaner (0.9.1)
debugger (1.5.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.7)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.7)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.0)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.0)
diff-lcs (1.2.1)
dynamic_form (1.1.4)
email_reply_parser_ffcrm (0.5.0)
erubis (2.7.0)
eventmachine (1.0.0)
execjs (1.3.1)
multi_json (~> 1.0)
factory_girl (3.0.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (3.0.0)
factory_girl (~> 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
ffaker (1.14.0)
ffi (1.2.0)
ffi (1.5.0)
haml (3.1.7)
headless (1.0.1)
highline (1.6.15)
Expand All @@ -116,11 +115,6 @@ GEM
json (1.7.7)
kgio (2.7.4)
libv8 (3.3.10.4)
libwebsocket (0.1.7.1)
addressable
websocket
linecache (0.46)
rbx-require-relative (> 0.0.4)
mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
Expand All @@ -135,7 +129,7 @@ GEM
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.6)
nokogiri (1.5.8)
paper_trail (2.6.3)
activerecord (~> 3.0)
railties (~> 3.0)
Expand All @@ -144,7 +138,7 @@ GEM
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
mime-types
pg (0.13.2)
pg (0.14.1)
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
Expand Down Expand Up @@ -201,7 +195,6 @@ GEM
ransack_ui (1.1.0)
ransack
ransack_chronic (>= 1.1.0)
rbx-require-relative (0.0.9)
rdoc (3.12.2)
json (~> 1.4)
responds_to_parent (1.1.0)
Expand All @@ -216,11 +209,6 @@ GEM
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
rubyzip (0.9.9)
sass (3.2.1)
sass-rails (3.2.5)
Expand All @@ -229,11 +217,11 @@ GEM
tilt (~> 1.3)
select2-rails (3.2.1)
thor (~> 0.14)
selenium-webdriver (2.27.2)
selenium-webdriver (2.31.0)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
websocket (~> 1.0.4)
simple_form (2.0.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
Expand All @@ -243,7 +231,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
sqlite3 (1.3.7)
therubyracer (0.10.1)
libv8 (~> 3.3.10)
thin (1.5.0)
Expand All @@ -268,9 +256,9 @@ GEM
raindrops (~> 0.7)
valium (0.5.0)
activerecord (>= 3.0.2)
websocket (1.0.6)
websocket (1.0.7)
will_paginate (3.0.3)
xpath (0.1.4)
xpath (1.0.0)
nokogiri (~> 1.3)

PLATFORMS
Expand All @@ -279,31 +267,31 @@ PLATFORMS
DEPENDENCIES
acts-as-taggable-on (~> 2.3.3)
acts_as_commentable (~> 3.0.1)
acts_as_fu (~> 0.0.8)
acts_as_fu
acts_as_list (~> 0.1.4)
ajax-chosen-rails (>= 0.2.1)
authlogic (= 3.1.0)
bundler_local_development
cancan
capistrano
capistrano_colors
capybara (~> 1.1)
capybara
cocaine
coffee-rails (~> 3.2.1)
database_cleaner
debugger
dynamic_form
email_reply_parser_ffcrm
execjs
factory_girl_rails (~> 3.0.0)
factory_girl_rails
ffaker (>= 1.12.0)
haml (~> 3)
headless
jquery-rails (~> 2.1.4)
nokogiri
paper_trail
paperclip (~> 2.8.0)
pg (~> 0.13.2)
pg
premailer
prototype-rails
pry-rails
Expand All @@ -314,7 +302,6 @@ DEPENDENCIES
ransack_ui (>= 1.1.0)
responds_to_parent (>= 1.1.0)
rspec-rails
ruby-debug
sass (~> 3)
sass-rails (~> 3.2.3)
select2-rails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Put your acceptance spec helpers inside /spec/acceptance/support
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configuration.before(:each, :type => :request) do
RSpec.configuration.before(:each) do
PaperTrail.enabled = true
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path("../acceptance_helper.rb", __FILE__)
require 'features/acceptance_helper'

feature 'Accounts', %q{
In order to increase customer satisfaction
Expand Down Expand Up @@ -32,7 +32,7 @@
click_button 'Create Account'

page.should have_content('My new account')
click_link 'My new account'
find('div#accounts').click_link('My new account') # avoid recent items link
page.should have_content('+1 2345 6789')
page.should have_content('http://www.example.com')
page.should have_content('This account is very important')
Expand Down Expand Up @@ -61,7 +61,7 @@
scenario 'should view and edit an account', :js => true do
FactoryGirl.create(:account, :name => "A new account")
visit accounts_page
click_link 'A new account'
find('div#accounts').click_link('A new account')
page.should have_content('A new account')
click_link 'Edit'
fill_in 'account_name', :with => 'A new account *editted*'
Expand All @@ -75,7 +75,7 @@
scenario 'should delete an account', :js => true do
FactoryGirl.create(:account, :name => "My new account")
visit accounts_page
click_link 'My new account'
find('div#accounts').click_link('My new account')
click_link 'Delete?'
page.should have_content('Are you sure you want to delete this account?')
click_link 'Yes'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def do_login_if_not_already(options = {})

end

RSpec.configuration.include HelperMethods, :type => :request
RSpec.configuration.include HelperMethods, :type => :feature
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def campaigns_page
def tasks_page
tasks_path
end

def groups_page
admin_groups_path
end

def opportunity_overview_page
opportunities_overview_users_path
end

end

RSpec.configuration.include NavigationHelpers, :type => :request
RSpec.configuration.include NavigationHelpers, :type => :feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def click_delete_for_task_id(task_id)
end
end

RSpec.configuration.include SelectorHelpers, :type => :request
RSpec.configuration.include SelectorHelpers, :type => :feature
File renamed without changes.
18 changes: 4 additions & 14 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ENV["RAILS_ENV"] = 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rails'

require 'acts_as_fu'
require 'factory_girl'
Expand All @@ -22,13 +23,7 @@
Paperclip.options[:log] = false

RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr

config.mock_with :rspec

config.fixture_path = "#{Rails.root}/spec/fixtures"
Expand All @@ -53,10 +48,10 @@
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before :all, :type => :request do
config.before :all, :type => :feature do
DatabaseCleaner.clean_with(:truncation)
end
config.around :each, :type => :request do |example|
config.around :each, :type => :feature do |example|
DatabaseCleaner.strategy = :truncation
example.run
DatabaseCleaner.strategy = :transaction
Expand All @@ -67,11 +62,6 @@
DatabaseCleaner.clean
end


# config.before :all, :type => :view do
# view.lookup_context.prefixes << 'entities'
# end

# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
Expand Down

0 comments on commit 9f4fcb8

Please sign in to comment.