Sha256: da803adbfb19d0ab5efae506062b9ace807894943e9a4dc41a924b1573fde0e1

Contents?: true

Size: 555 Bytes

Versions: 1

Compression:

Stored size: 555 Bytes

Contents

require "spec_helper"

describe AngularSprinkles::Directive::Input do
  let(:args) { { "key" => value } }

  subject { described_class.new(args) }

  context "when the value is a string" do
    let(:value) { "value" }

    it "does nothing to the value" do
      expect(subject.attributes).to eq({ data: args })
    end
  end

  context "when the value is not a string" do
    let(:value) { double(to_json: 1) }

    it "turns the args hash into a jsonified data hash" do
      expect(subject.attributes).to eq({ data: { "key" => 1 } })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
angular_sprinkles-0.2.14 spec/angular_sprinkles/directive/input_spec.rb