Sha256: cbb9c353504984ae0d4cc7486bd0828281465a7fc9edf662b8728f23b72f7c4e

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 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-div")).to have_content("bigHelloWorldCtrlAttribute")
    expect(find("#directive-ctrl-call-div")).to have_content('func result')
    expect(find("#ctrl-div")).to have_content(42)
    expect(find("#isolate-div")).to have_content(42)
    expect(find("#wrap-div")).to have_content(11)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
angular_sprinkles-0.3.3 spec/features/javascript_bindings_spec.rb