File tree Expand file tree Collapse file tree 8 files changed +47
-11
lines changed Expand file tree Collapse file tree 8 files changed +47
-11
lines changed Original file line number Diff line number Diff line change 11
11
.idea
12
12
.sass-cache
13
13
.vagrant
14
+ .rspec
14
15
.yardoc
15
16
/.bundle
16
17
/config /application.yml
@@ -56,3 +57,4 @@ git_stats
56
57
vcr_cassettes
57
58
dump
58
59
BACKUP
60
+ Guardfile
Original file line number Diff line number Diff line change 1
1
--require spec_helper
2
- --format Fuubar
2
+ --format documentation
3
3
--color
4
- --profile
4
+ # --profile
Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ group :test do
169
169
# gem 'rspec-its'
170
170
gem 'capybara'
171
171
gem 'capybara-screenshot'
172
+ gem 'rack_session_access' # allows to set session from within Capybara
173
+ gem 'poltergeist' # headless js driver for Capybara that uses phantomJs
172
174
gem 'codeclimate-test-reporter' , require : false
173
175
gem 'database_cleaner'
174
176
gem 'fuubar' , '2.0.0.rc1'
Original file line number Diff line number Diff line change 140
140
choice (0.1.6 )
141
141
chronic (0.10.2 )
142
142
chunky_png (1.3.1 )
143
+ cliver (0.3.2 )
143
144
clockwork (0.7.7 )
144
145
activesupport
145
146
tzinfo
431
432
slop (~> 3.4 , >= 3.4.5 )
432
433
pg (0.17.1 )
433
434
pg_array_parser (0.0.9 )
435
+ poltergeist (1.5.1 )
436
+ capybara (~> 2.1 )
437
+ cliver (~> 0.3.1 )
438
+ multi_json (~> 1.0 )
439
+ websocket-driver (>= 0.2.0 )
434
440
polyamorous (0.5.0 )
435
441
activerecord (~> 3.0 )
436
442
polyglot (0.3.5 )
485
491
rack
486
492
rack-test (0.6.2 )
487
493
rack (>= 1.0 )
494
+ rack_session_access (0.1.1 )
495
+ builder (>= 2.0.0 )
496
+ rack (>= 1.0.0 )
488
497
rails (3.2.19 )
489
498
actionmailer (= 3.2.19 )
490
499
actionpack (= 3.2.19 )
700
709
addressable (>= 2.2.7 )
701
710
crack (>= 0.3.2 )
702
711
websocket (1.2.0 )
712
+ websocket-driver (0.3.5 )
703
713
xpath (2.0.0 )
704
714
nokogiri (~> 1.3 )
705
715
yard (0.8.7.4 )
@@ -776,13 +786,15 @@ DEPENDENCIES
776
786
omniauth-linkedin (~> 0.0.6 )
777
787
omniauth-twitter (~> 0.0.16 )
778
788
pg
789
+ poltergeist
779
790
postgres_ext
780
791
pry-byebug
781
792
pry-rescue
782
793
pubnub (= 0.1.9 )
783
794
puma
784
795
querystring
785
796
quiet_assets
797
+ rack_session_access
786
798
rails (~> 3.2 )
787
799
rails-assets-font-awesome
788
800
rails-assets-jquery-cookie (= 1.4.0 )
Original file line number Diff line number Diff line change 34
34
Rails . application . config . sass . cache_location = "/tmp/codewall-cache/sass/"
35
35
36
36
BetterErrors ::Middleware . allow_ip! ENV [ 'TRUSTED_IP' ] if ENV [ 'TRUSTED_IP' ]
37
+ Rails . logger = Logger . new ( STDOUT )
38
+ Rails . logger . level = Logger ::DEBUG
37
39
end
Original file line number Diff line number Diff line change 3
3
config . cache_classes = false
4
4
config . whiny_nils = true
5
5
config . consider_all_requests_local = true
6
- config . action_dispatch . show_exceptions = false
6
+ config . action_dispatch . show_exceptions = true
7
7
config . action_controller . allow_forgery_protection = false
8
8
config . action_mailer . delivery_method = :test
9
9
config . active_support . deprecation = :stderr
13
13
14
14
# Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
15
15
config . assets . allow_debugging = true
16
+
17
+ config . middleware . use RackSessionAccess ::Middleware # alloes to set session from within Capybara
18
+
19
+ Rails . logger = Logger . new ( STDOUT )
20
+ Rails . logger . level = Logger ::DEBUG # provides more verbose output testing with headless browsers in case of errors
16
21
end
Original file line number Diff line number Diff line change 1
- require 'spec_helper.rb'
1
+ require 'spec_helper.rb'
2
+ require 'capybara/poltergeist'
3
+ require 'rack_session_access/capybara'
4
+
5
+ Capybara . javascript_driver = :poltergeist
6
+ Capybara . default_wait_time = 5
7
+
8
+ RSpec . configure do |config |
9
+ config . before ( :example , js : :true ) do
10
+ DatabaseCleaner . strategy = :truncation
11
+ ActiveRecord ::Base . establish_connection
12
+ end
13
+
14
+ config . include Features ::GeneralHelpers , type : :feature
15
+ end
Original file line number Diff line number Diff line change 29
29
config . use_transactional_fixtures = false
30
30
config . use_transactional_examples = false
31
31
32
- config . before ( :all ) do
32
+ config . before ( :suite ) do
33
33
Redis . current . SELECT ( testdb = 1 )
34
34
Redis . current . flushdb
35
-
36
35
end
37
36
38
37
config . before ( :suite ) do
39
-
40
- DatabaseCleaner . strategy = :transaction
41
38
DatabaseCleaner . clean_with ( :truncation )
42
39
end
43
40
44
- config . before ( :each ) do
45
- Mongoid :: Sessions . default . collections . reject { | c | c . name =~ /^system/ } . each ( & :drop )
41
+ config . before ( :example ) do
42
+ DatabaseCleaner . strategy = :transaction
46
43
DatabaseCleaner . start
44
+
45
+ Mongoid ::Sessions . default . collections . reject { |c | c . name =~ /^system/ } . each ( &:drop )
47
46
ActionMailer ::Base . deliveries . clear
48
47
end
49
48
50
- config . after ( :each ) do
49
+ config . after ( :example ) do
51
50
DatabaseCleaner . clean
52
51
end
53
52
You can’t perform that action at this time.
0 commit comments