mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 16:57:11 +02:00
Add feature spec for /daemon/setting
This commit is contained in:
parent
566d167c7f
commit
27807cf259
@ -1,3 +1,5 @@
|
||||
require "fluent/config/v1_parser"
|
||||
|
||||
class Fluentd::SettingsController < ApplicationController
|
||||
before_action :login_required
|
||||
before_action :find_fluentd
|
||||
|
33
spec/features/setting_spec.rb
Normal file
33
spec/features/setting_spec.rb
Normal file
@ -0,0 +1,33 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'setting', stub: :daemon do
|
||||
let!(:exists_user) { build(:user) }
|
||||
|
||||
before do
|
||||
login_with exists_user
|
||||
|
||||
daemon.agent.config_write 'GREAT CONFIG HERE'
|
||||
|
||||
visit '/daemon/setting'
|
||||
end
|
||||
|
||||
it 'shows setting' do
|
||||
page.should have_css('h1', text: I18n.t('fluentd.settings.show.page_title'))
|
||||
page.should have_link(I18n.t('terms.edit'))
|
||||
page.should have_css('pre', text: 'GREAT CONFIG HERE')
|
||||
end
|
||||
|
||||
it 'edits setting' do
|
||||
click_link I18n.t('terms.edit')
|
||||
|
||||
page.should have_css('h1', text: I18n.t('fluentd.settings.edit.page_title'))
|
||||
page.should have_css('p.text-danger', text: I18n.t('terms.notice_restart_for_config_edit', brand: 'fluentd'))
|
||||
|
||||
fill_in 'config', with: 'SUPER GREAT CONFIG HERE'
|
||||
|
||||
click_button I18n.t('terms.update')
|
||||
|
||||
current_path.should == '/daemon/setting'
|
||||
page.should have_css('pre', text: 'SUPER GREAT CONFIG HERE')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user