Sha256: 908ce0fd414927ed3126f0ce0b7addcb49e5e777404ff01c2a09c90de03b9f22

Contents?: true

Size: 1.18 KB

Versions: 12

Compression:

Stored size: 1.18 KB

Contents

require "spec_helper"

describe "out_elasticsearch" do
  let(:exists_user) { build(:user) }
  let(:daemon) { build(:fluentd, variant: "td-agent") }
  let(:match) { "test.out_elasticsearch.#{Time.now.to_i}.*" }
  let(:location) { daemon_setting_out_elasticsearch_path }

  before do
    Fluentd.stub(:instance).and_return(daemon)
    Fluentd::Agent::TdAgent.any_instance.stub(:detached_command).and_return(true)
    daemon.agent.config_write ""

    visit '/sessions/new'
    within("form") do
      fill_in 'session_name', :with => exists_user.name
      fill_in 'session_password', :with => exists_user.password
    end
    click_button I18n.t("terms.sign_in")
  end

  it "Shown form" do
    visit location
    page.should have_css('input[name="fluentd_setting_out_elasticsearch[match]"]')
  end

  it "Updated config after submit", js: true do
    daemon.agent.config.should_not include(match)
    visit location
    within('#new_fluentd_setting_out_elasticsearch') do
      fill_in "Match", with: match
      fill_in "Index name", with: "index"
      fill_in "Type name", with: "type_name"
    end
    click_button I18n.t("fluentd.common.finish")
    daemon.agent.config.should include(match)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fluentd-ui-0.3.9 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.8 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.7 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.6 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.5 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.3 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.2 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.1 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.3.0 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.2.0 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.1.4 spec/features/fluentd/setting/out_elasticsearch_spec.rb
fluentd-ui-0.1.3 spec/features/fluentd/setting/out_elasticsearch_spec.rb