Commit 67ba36eb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Revert "Revert "Fix for failing specs""

This reverts commit 2545b0f8.
parent 440036df
...@@ -199,7 +199,7 @@ group :development, :test do ...@@ -199,7 +199,7 @@ group :development, :test do
# gem 'rails-dev-tweaks' # gem 'rails-dev-tweaks'
gem 'spinach-rails' gem 'spinach-rails'
gem "rspec-rails" gem "rspec-rails"
gem "capybara" gem "capybara", '~> 2.2.1'
gem "pry" gem "pry"
gem "awesome_print" gem "awesome_print"
gem "database_cleaner" gem "database_cleaner"
...@@ -222,7 +222,7 @@ group :development, :test do ...@@ -222,7 +222,7 @@ group :development, :test do
gem 'rb-inotify', require: linux_only('rb-inotify') gem 'rb-inotify', require: linux_only('rb-inotify')
# PhantomJS driver for Capybara # PhantomJS driver for Capybara
gem 'poltergeist', '~> 1.4.1' gem 'poltergeist', '~> 1.5.1'
gem 'jasmine', '2.0.2' gem 'jasmine', '2.0.2'
......
...@@ -62,7 +62,7 @@ GEM ...@@ -62,7 +62,7 @@ GEM
celluloid (0.15.2) celluloid (0.15.2)
timers (~> 1.1.0) timers (~> 1.1.0)
charlock_holmes (0.6.9.4) charlock_holmes (0.6.9.4)
cliver (0.2.2) cliver (0.3.2)
code_analyzer (0.4.3) code_analyzer (0.4.3)
sexp_processor sexp_processor
coderay (1.1.0) coderay (1.1.0)
...@@ -283,9 +283,9 @@ GEM ...@@ -283,9 +283,9 @@ GEM
treetop (~> 1.4.8) treetop (~> 1.4.8)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25.1) mime-types (1.25.1)
mini_portile (0.5.3) mini_portile (0.6.0)
minitest (4.7.5) minitest (5.3.4)
multi_json (1.10.0) multi_json (1.10.1)
multi_xml (0.5.5) multi_xml (0.5.5)
multipart-post (1.2.0) multipart-post (1.2.0)
mysql2 (0.3.16) mysql2 (0.3.16)
...@@ -293,8 +293,8 @@ GEM ...@@ -293,8 +293,8 @@ GEM
net-scp (1.1.2) net-scp (1.1.2)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.8.0) net-ssh (2.8.0)
nokogiri (1.6.1) nokogiri (1.6.2.1)
mini_portile (~> 0.5.0) mini_portile (= 0.6.0)
nprogress-rails (0.1.2.3) nprogress-rails (0.1.2.3)
oauth (0.4.7) oauth (0.4.7)
oauth2 (0.8.1) oauth2 (0.8.1)
...@@ -326,9 +326,9 @@ GEM ...@@ -326,9 +326,9 @@ GEM
orm_adapter (0.5.0) orm_adapter (0.5.0)
pg (0.15.1) pg (0.15.1)
phantomjs (1.9.2.0) phantomjs (1.9.2.0)
poltergeist (1.4.1) poltergeist (1.5.1)
capybara (~> 2.1.0) capybara (~> 2.1)
cliver (~> 0.2.1) cliver (~> 0.3.1)
multi_json (~> 1.0) multi_json (~> 1.0)
websocket-driver (>= 0.2.0) websocket-driver (>= 0.2.0)
polyglot (0.3.4) polyglot (0.3.4)
...@@ -562,7 +562,7 @@ GEM ...@@ -562,7 +562,7 @@ GEM
webmock (1.16.0) webmock (1.16.0)
addressable (>= 2.2.7) addressable (>= 2.2.7)
crack (>= 0.3.2) crack (>= 0.3.2)
websocket-driver (0.3.1) websocket-driver (0.3.3)
xpath (2.0.0) xpath (2.0.0)
nokogiri (~> 1.3) nokogiri (~> 1.3)
...@@ -578,7 +578,7 @@ DEPENDENCIES ...@@ -578,7 +578,7 @@ DEPENDENCIES
better_errors better_errors
binding_of_caller binding_of_caller
bootstrap-sass (~> 3.0) bootstrap-sass (~> 3.0)
capybara capybara (~> 2.2.1)
carrierwave carrierwave
coffee-rails coffee-rails
colored colored
...@@ -635,7 +635,7 @@ DEPENDENCIES ...@@ -635,7 +635,7 @@ DEPENDENCIES
omniauth-twitter omniauth-twitter
org-ruby org-ruby
pg pg
poltergeist (~> 1.4.1) poltergeist (~> 1.5.1)
protected_attributes protected_attributes
pry pry
quiet_assets (~> 1.0.1) quiet_assets (~> 1.0.1)
......
...@@ -28,7 +28,7 @@ WebMock.allow_net_connect! ...@@ -28,7 +28,7 @@ WebMock.allow_net_connect!
require 'capybara/poltergeist' require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :poltergeist
Capybara.register_driver :poltergeist do |app| Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, :js_errors => false, :timeout => 60) Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: 90)
end end
Spinach.hooks.on_tag("javascript") do Spinach.hooks.on_tag("javascript") do
::Capybara.current_driver = ::Capybara.javascript_driver ::Capybara.current_driver = ::Capybara.javascript_driver
......
require 'database_cleaner'
RSpec.configure do |config| RSpec.configure do |config|
config.before do config.around(:each) do
if example.metadata[:js] DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.strategy = :truncation end
Capybara::Selenium::Driver::DEFAULT_OPTIONS[:resynchronize] = true
else config.around(:each) do
DatabaseCleaner.strategy = :transaction DatabaseCleaner.strategy = :transaction
end end
unless example.metadata[:no_db] config.around(:each, js: true) do
DatabaseCleaner.start DatabaseCleaner.strategy = :truncation
end end
config.before(:each) do
DatabaseCleaner.start
end end
config.after do config.after(:each) do
unless example.metadata[:no_db]
DatabaseCleaner.clean DatabaseCleaner.clean
end end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment