Class: RspecApiHelpers::Strategies::LoginHashStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_api_helpers/strategies/login_hash_strategy.rb

Instance Method Summary collapse

Constructor Details

#initializeLoginHashStrategy

Returns a new instance of LoginHashStrategy.



6
7
8
# File 'lib/rspec_api_helpers/strategies/login_hash_strategy.rb', line 6

def initialize
  @strategy = FactoryGirl.strategy_by_name(:create).new
end

Instance Method Details

#result(evaluation) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/rspec_api_helpers/strategies/login_hash_strategy.rb', line 12

def result(evaluation)
  user = @strategy.result(evaluation)

  {
    'user' => {
      'email' => user.email,
      'password' => user.password
    }
  }
end