Sha256: e4cce9f51d65cd453cc7b29e49e193d9179bfa42d9e4139d240c33ff6403bc59

Contents?: true

Size: 726 Bytes

Versions: 18

Compression:

Stored size: 726 Bytes

Contents

require 'spec_helper'

describe AngularSprinkles::FormBinder::Default do
  let(:method) { ->(arg1, arg2, arg3 = {}, arg4 = {}, arg5 = {}) {} }
  let(:args) { [:attribute, :something_else] }
  let(:attribute_binding) { double }
  let(:object) { double(bind: attribute_binding) }
  let(:params) { { method: method, args: args, object: object } }

  it 'returns the arguments with the second one augmented' do
    augmented_args = described_class.new(params).call

    expect(augmented_args[0]).to eq(:attribute)
    expect(augmented_args[1]).to eq(:something_else)
    expect(augmented_args[2]).to eq({})
    expect(augmented_args[3]).to eq({})
    expect(augmented_args[4]).to eq({ "ng-model" => attribute_binding })
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
angular_sprinkles-0.3.3 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.3.2 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.3.1 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.3.0 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.14 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.13 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.12 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.11 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.10 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.9 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.8 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.7 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.6 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.5 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.4 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.3 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.2 spec/angular_sprinkles/form_binder/default_spec.rb
angular_sprinkles-0.2.1 spec/angular_sprinkles/form_binder/default_spec.rb