mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 02:46:11 +02:00
Add feature spec for in_http setting.
This commit is contained in:
parent
155e33d6dd
commit
c1a35ffbf4
36
spec/features/fluentd/setting/in_http_spec.rb
Normal file
36
spec/features/fluentd/setting/in_http_spec.rb
Normal file
@ -0,0 +1,36 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe "in_http" do
|
||||
let(:exists_user) { build(:user) }
|
||||
let(:daemon) { build(:fluentd, variant: "td-agent") }
|
||||
let(:port) { "12345" }
|
||||
|
||||
#TODO: wanna DRY with shared_context
|
||||
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 with filled in td.*.* on match" do
|
||||
visit daemon_setting_in_http_path
|
||||
page.should have_css('input[name="fluentd_setting_in_http[port]"]')
|
||||
end
|
||||
|
||||
it "Updated config after submit" do
|
||||
daemon.agent.config.should_not include(port)
|
||||
visit daemon_setting_in_http_path
|
||||
within('#new_fluentd_setting_in_http') do
|
||||
fill_in "Port", with: port
|
||||
end
|
||||
click_button I18n.t("fluentd.common.finish")
|
||||
daemon.agent.config.should include(port)
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user