Sha256: 7447cd58b807c1dda99a6b83598b8fcb795dceff2f1d86565bd9533fa0200ba5

Contents?: true

Size: 818 Bytes

Versions: 5

Compression:

Stored size: 818 Bytes

Contents

require "application_system_test_case"

class OutElasticsearchTest < ApplicationSystemTestCase
  setup do
    login_with(FactoryBot.build(:user))
    @daemon = stub_daemon
    @pattern = "test.out_forward.#{Time.now.to_i}.*"
  end

  test "show form" do
    visit(daemon_setting_out_elasticsearch_path)
    assert do
      page.has_css?('input[name="setting[pattern]"]')
    end
  end

  test "Update config" do
    assert do
      !@daemon.agent.config.include?(@pattern)
    end
    visit(daemon_setting_out_elasticsearch_path)
    within("form") do
      fill_in("Pattern", with: @pattern)
      fill_in("Index name", with: "index")
      fill_in("Type name", with: "type_name")
    end
    click_button(I18n.t("fluentd.common.finish"))
    assert do
      @daemon.agent.config.include?(@pattern)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fluentd-ui-1.2.1 test/system/fluentd/setting/out_elasticsearch_test.rb
fluentd-ui-1.2.0 test/system/fluentd/setting/out_elasticsearch_test.rb
fluentd-ui-1.1.0 test/system/fluentd/setting/out_elasticsearch_test.rb
fluentd-ui-1.0.1 test/system/fluentd/setting/out_elasticsearch_test.rb
fluentd-ui-1.0.0 test/system/fluentd/setting/out_elasticsearch_test.rb