Sha256: aab16b35cb443dff1eada7643050071e9e8218b2c14b65b48fe4a7147016ad1d

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

require "rails_helper"

feature "javascript_bindings", js: true do
  let(:name) { 'name' }
  let(:new_name) { 'namenamename?' }

  before do
    visit javascript_bindings_path(name: name)
  end

  it "should test all the things" do
    # these elements start with the @model binding
    expect(find("#data-binding-div")).to have_content(name)
    expect(find("#bind-service-div")).to have_content("Hello #{name}")
    expect(find("#directive-div h1 h2")).to have_content(name)

    # this element starts out empty
    expect { find("#bind-div") }.to raise_error

    fill_in("Input", with: new_name)
    expect(find("#data-binding-div")).to have_content(new_name)
    expect(find("#bind-service-div")).to have_content("Hello #{new_name}")
    expect(find("#directive-div h1 h2")).to have_content(new_name)

    fill_in("Bind", with: new_name)
    expect(find("#bind-div")).to have_content(new_name)

    # directive controller results
    expect(find("#directive-ctrl-bind")).to have_content("bigHelloWorldCtrlAttribute")
    expect(find("#directive-ctrl-call")).to have_content('func result')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
angular_sprinkles-0.2.14 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.13 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.12 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.11 spec/features/javascript_bindings_spec.rb