lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.54 vs lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.55

- old
+ new

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