-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathspec_helper.rb
More file actions
57 lines (49 loc) · 1.94 KB
/
Copy pathspec_helper.rb
File metadata and controls
57 lines (49 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require "capybara/rspec"
require "webmock/rspec"
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f }
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper methods
# defined using `chain`, e.g.:
# be_bigger_than(2).and_smaller_than(4).description
# # => "be bigger than 2 and smaller than 4"
# ...rather than:
# # => "be bigger than 2"
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
# rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
config.mock_with :rspec do |mocks|
# Prevents you from mocking or stubbing a method that does not exist on
# a real object. This is generally recommended, and will default to
# `true` in RSpec 4.
mocks.verify_partial_doubles = true
end
config.around(:each, :run_delayed_jobs) do |example|
Delayed::Worker.delay_jobs = false
example.run
Delayed::Worker.delay_jobs = true
end
config.include Capybara::DSL
WebMock.disable_net_connect!(allow_localhost: true, allow: "chromedriver.storage.googleapis.com")
end
# Don't prevent form fills by bots during the test run
InvisibleCaptcha.setup do |config|
config.timestamp_enabled = false
end
def set_weak_password(user)
weak_password = "12345678"
user.password = weak_password
user.password_confirmation = weak_password
user.save
end
def set_strong_password(user)
weak_password = "strong passwords defeat lobsters covering wealth"
user.password = weak_password
user.password_confirmation = weak_password
user.save
end