Sha256: e593dea397973f19b58a73325bb3c36312b456143f54366bd6b86037ea4b3bb1
Contents?: true
Size: 906 Bytes
Versions: 13
Compression:
Stored size: 906 Bytes
Contents
RSpec.describe Card::Set::Abstract::Pointer::OptionsApi do def define_options_rule type_id, content Card.create! name: %i[pointer type options], type_id: type_id, content: content end let :sample_pointer do Card.new type_id: Card::PointerID end describe "#options_hash", as_bot: true do let(:options_hash) do sample_pointer.options_hash end context "when options card is a pointer" do before do define_options_rule Card::PointerID, %w[A B] end it "takes name and value from cardname" do expect(options_hash).to eq("A" => "A", "B" => "B") end end context "when options card is a JSON" do before do define_options_rule Card::JsonID, '{"A": "C", "B": "D"}' end it "takes key/value pairs from JSON hash" do expect(options_hash).to eq("A" => "C", "B" => "D") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems