lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.64 vs lib/rspeckled/plugins/authentication.rb in rspeckled-1.0.0
- old
+ new
@@ -1,16 +1,16 @@
# frozen_string_literal: true
# rubocop:disable Layout/IndentHash
RSpec.configure do |config|
- config.around(:each, :auth => lambda { |v| !!v }) do |example|
- options = if example.metadata[:auth].is_a?(Hash)
- example.metadata[:auth]
+ config.around(:each, :authentication => lambda { |v| !!v }) do |example|
+ options = if example.metadata[:authentication].is_a?(Hash)
+ example.metadata[:authentication]
else
{
:token => {
- :roles => example.metadata[:auth],
+ :roles => example.metadata[:authentication],
},
}
end
options[:class] ||= described_class
@@ -91,10 +91,10 @@
end
instance.delete unless options[:strategy] == :instance
end
- config.before(:each, :auth => lambda { |v| !!v }) do |_example|
+ config.before(:each, :authentication => lambda { |v| !!v }) do |_example|
request.env['X_JSON_WEB_TOKEN'] = @token_data
end
end
# rubocop:enable Layout/IndentHash