Sha256: 51174d6bfdcddb2ffa6c53f2b18db971734a235e2ec078732cf33dccb5e5ad4e

Contents?: true

Size: 820 Bytes

Versions: 39

Compression:

Stored size: 820 Bytes

Contents

class Ey::Core::Client
  class Real
    def create_password_reset(params)
      request(
        :method => :post,
        :path   => "/password-resets",
        :body   => {
          :password_reset => params
        }
      )
    end
  end # Real

  class Mock
    def create_password_reset(_params)
      params = Cistern::Hash.stringify_keys(_params)

      unless self.data[:users].map{ |_, user| user["email"] }.include?(params["email"])
        response(
          :body => {
            :errors => ["Could not find User with email \"#{params["email"]}\""]
          },
          :status => 404
        )
      end

      response(
        :body => {
          "password_reset" => {
            "sent" => true
          },
        },
        :status  => 201,
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/create_password_reset.rb
ey-core-3.6.4 lib/ey-core/requests/create_password_reset.rb
ey-core-3.6.3 lib/ey-core/requests/create_password_reset.rb
ey-core-3.6.1 lib/ey-core/requests/create_password_reset.rb
groove-ey-core-3.6.3 lib/ey-core/requests/create_password_reset.rb
groove-ey-core-3.6.2 lib/ey-core/requests/create_password_reset.rb
groove-ey-core-3.6.1 lib/ey-core/requests/create_password_reset.rb
ey-core-3.5.0 lib/ey-core/requests/create_password_reset.rb
ey-core-3.4.4 lib/ey-core/requests/create_password_reset.rb
ey-core-3.4.2 lib/ey-core/requests/create_password_reset.rb
ey-core-3.4.1 lib/ey-core/requests/create_password_reset.rb
ey-core-3.4.0 lib/ey-core/requests/create_password_reset.rb
ey-core-3.3.1 lib/ey-core/requests/create_password_reset.rb
ey-core-3.3.0 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.6 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.5 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.4 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.3 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.2 lib/ey-core/requests/create_password_reset.rb
ey-core-3.2.1 lib/ey-core/requests/create_password_reset.rb