Sha256: f4c60cf86540bfd1a523ff93c3cd2c0ae393226fcde19bbd2605b78cba3e5148

Contents?: true

Size: 986 Bytes

Versions: 5

Compression:

Stored size: 986 Bytes

Contents

require "rails_helper"

# javascript specs are slow, so test everything at
# once on a single page

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)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
angular_sprinkles-0.2.4 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.3 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.2 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.1 spec/features/javascript_bindings_spec.rb
angular_sprinkles-0.2.0 spec/features/javascript_bindings_spec.rb