Sha256: 7d4126b361b6387f600128479a1d1bedbd87a69673b36f069469b8546ff9079f

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 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.13 spec/angular_sprinkles/directive/input_spec.rb