Sha256: db8b133ace379d033f91b1cb1f460bc88567950c63e5a01dbb09c200ce6f440e

Contents?: true

Size: 530 Bytes

Versions: 7

Compression:

Stored size: 530 Bytes

Contents

require "test_helper"

class DocsActivityTest < Minitest::Spec
  Memo = Struct.new(:body)

  class Memo::Create < Trailblazer::Operation
    step :create_model
    def create_model(ctx, params:, **)
      ctx[:model] = Memo.new(params[:body])
    end
  end

  #:describe
  describe Memo::Create do
    it "creates a sane Memo instance" do
      result = Memo::Create.( params: { body: "Enjoy an IPA" } )

      result.success?.must_equal true
      result[:model].body.must_equal "Enjoy an IPA"
    end
  end
  #:describe end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trailblazer-operation-0.4.1 test/docs/operation_test.rb
trailblazer-operation-0.4.0 test/docs/operation_test.rb
trailblazer-operation-0.3.1 test/docs/operation_test.rb
trailblazer-operation-0.3.0 test/docs/operation_test.rb
trailblazer-operation-0.2.5 test/docs/operation_test.rb
trailblazer-operation-0.2.4 test/docs/operation_test.rb
trailblazer-operation-0.2.3 test/docs/operation_test.rb