Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9eb44dd79036
Commit
86edfce4
authored
Apr 25, 2015
by
Robert Speicher
Browse files
Move RSpec setup for Capybara to its own support file
parent
743d36417e61
Changes
2
Hide whitespace changes
Inline
Side-by-side
spec/spec_helper.rb
View file @
9eb44dd7
...
...
@@ -10,19 +10,13 @@
ENV
[
"RAILS_ENV"
]
||=
'test'
require
File
.
expand_path
(
"../../config/environment"
,
__FILE__
)
require
'rspec/rails'
require
'capybara/rails'
require
'capybara/rspec'
require
'webmock/rspec'
require
'email_spec'
require
'sidekiq/testing/inline'
require
'capybara/poltergeist'
Capybara
.
javascript_driver
=
:poltergeist
Capybara
.
default_wait_time
=
10
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
...
...
spec/support/capybara.rb
0 → 100644
View file @
9eb44dd7
require
'capybara/rails'
require
'capybara/rspec'
require
'capybara/poltergeist'
# Give CI some extra time
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
90
:
10
Capybara
.
javascript_driver
=
:poltergeist
Capybara
.
register_driver
:poltergeist
do
|
app
|
Capybara
::
Poltergeist
::
Driver
.
new
(
app
,
js_errors:
false
,
timeout:
timeout
)
end
Capybara
.
default_wait_time
=
timeout
Capybara
.
ignore_hidden_elements
=
true
require
'capybara-screenshot/rspec'
# Keep only the screenshots generated from the last failing test suite
Capybara
::
Screenshot
.
prune_strategy
=
:keep_last_run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment