Sha256: a49077f2b1362d521c9a3ab98c170b13f32c7fbd45f0107a5ad549c5b909d718

Contents?: true

Size: 695 Bytes

Versions: 33

Compression:

Stored size: 695 Bytes

Contents

require "hanami_helper"

RSpec.describe <%= configuration.project_namespaced_class %>::Refines::Actions::Response do
  using described_class

  subject(:response) { Hanami::Action::Response.new request:, config: {} }

  let :request do
    Rack::MockRequest.env_for("/").then { |env| Hanami::Action::Request.new env:, params: {} }
  end

  describe "#with" do
    it "answers response with given body and status" do
      expect(response.with(body: "Danger!", status: 400)).to have_attributes(
        body: ["Danger!"],
        status: 400
      )
    end

    it "answers itself" do
      expect(response.with(body: "Danger!", status: 400)).to be_a(Hanami::Action::Response)
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
hanamismith-0.38.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.37.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.34.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.33.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.32.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.31.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.30.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.29.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.28.1 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.28.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.27.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.26.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.25.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.24.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.23.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.22.1 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.22.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.21.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.20.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
hanamismith-0.19.0 lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb