forked from saml-idp/saml_idp
-
Notifications
You must be signed in to change notification settings - Fork 5
/
spec_helper.rb
46 lines (36 loc) · 998 Bytes
/
spec_helper.rb
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
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
$LOAD_PATH.unshift File.dirname(__FILE__)
warn("Running Specs under Ruby Version #{RUBY_VERSION}")
require 'rails_app/config/environment'
require 'rspec'
require 'capybara/rspec'
require 'capybara/rails'
require 'ruby-saml'
require 'saml_idp'
require 'timecop'
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
RSpec.configure do |config|
config.mock_with :rspec
config.order = 'random'
config.include CertificateHelpers
config.include SamlRequestMacros
config.include SecurityHelpers
config.before do
SamlIdp.configure do |c|
c.attributes = {
emailAddress: {
name: 'email-address',
getter: ->(_p) { '[email protected]' },
},
}
c.name_id.formats = {
email_address: ->(_p) { '[email protected]' },
}
end
end
end
Capybara.default_host = 'https://app.example.com'