Use login macro

This commit is contained in:
Koichi TANAKA 2014-12-03 12:02:33 +09:00
parent c638372499
commit 202be9592f
5 changed files with 10 additions and 46 deletions

View File

@ -11,12 +11,7 @@ describe "out_elasticsearch" do
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")
login_with exists_user
end
it "Shown form" do

View File

@ -9,13 +9,8 @@ describe "out_forward" 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")
login_with exists_user
end
it "Shown form" do

View File

@ -9,13 +9,8 @@ describe "out_td" 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")
login_with exists_user
end
it "Shown form with filled in td.*.* on match" do

View File

@ -7,15 +7,8 @@ describe "source_and_output", js: true do
before do
Fluentd.stub(:instance).and_return(daemon)
Fluentd::Agent::TdAgent.any_instance.stub(:detached_command).and_return(true)
end
before do
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")
login_with exists_user
end
before do

View File

@ -5,12 +5,7 @@ describe "sessions" do
describe "sign in with default password" do
before do
visit '/sessions/new'
within("form") do
fill_in 'session_name', :with => user.name
fill_in 'session_password', :with => user.password
end
click_button submit_label
login_with user
end
context "correct credentials" do
@ -40,12 +35,8 @@ describe "sessions" do
before do
exists_user.update_attributes(current_password: Settings.default_password, password: new_password, password_confirmation: new_password)
visit '/sessions/new'
within("form") do
fill_in 'session_name', :with => user.name
fill_in 'session_password', :with => user.password
end
click_button submit_label
login_with user
end
after do
@ -71,12 +62,7 @@ describe "sessions" do
describe "sign out process" do
let(:submit_label) { I18n.t("terms.sign_in") }
before do
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 submit_label
login_with exists_user
end
before do