mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 01:07:09 +02:00
Apply to syntax_sugar of factorygirl
This commit is contained in:
parent
942ee6ddb4
commit
0fe75a69a1
@ -1,5 +1,5 @@
|
|||||||
describe "sessions" do
|
describe "sessions" do
|
||||||
let(:exists_user) { FactoryGirl.create(:user) }
|
let(:exists_user) { create(:user) }
|
||||||
|
|
||||||
describe "the sign in process" do
|
describe "the sign in process" do
|
||||||
let(:submit_label) { I18n.t("terms.sign_in") }
|
let(:submit_label) { I18n.t("terms.sign_in") }
|
||||||
@ -20,7 +20,7 @@ describe "sessions" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "sign in with non-exists user" do
|
context "sign in with non-exists user" do
|
||||||
let(:user) { FactoryGirl.build(:user) }
|
let(:user) { build(:user) }
|
||||||
|
|
||||||
it "current location is not root_path" do
|
it "current location is not root_path" do
|
||||||
current_path.should_not == root_path
|
current_path.should_not == root_path
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
describe "users" do
|
describe "users" do
|
||||||
let(:exists_user) { FactoryGirl.create(:user) }
|
let(:exists_user) { create(:user) }
|
||||||
|
|
||||||
describe "edit" do
|
describe "edit" do
|
||||||
let(:url) { user_path }
|
let(:url) { user_path }
|
||||||
|
@ -5,7 +5,7 @@ describe Fluentd do
|
|||||||
let(:path) { fluentd.send(column) }
|
let(:path) { fluentd.send(column) }
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
fluentd.check_permission(column)
|
fluentd.check_permission(column)
|
||||||
fluentd.errors
|
fluentd.errors
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ describe Fluentd do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:fluentd) { FactoryGirl.build(:fluentd) }
|
let(:fluentd) { build(:fluentd) }
|
||||||
|
|
||||||
describe "#valid?" do
|
describe "#valid?" do
|
||||||
before do
|
before do
|
||||||
|
@ -7,10 +7,10 @@ describe LoginToken do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
active.times do |n|
|
active.times do |n|
|
||||||
FactoryGirl.create(:login_token, expired_at: (n + 1).day.from_now)
|
create(:login_token, expired_at: (n + 1).day.from_now)
|
||||||
end
|
end
|
||||||
inactive.times do |n|
|
inactive.times do |n|
|
||||||
FactoryGirl.create(:login_token, expired_at: (n + 1).day.ago)
|
create(:login_token, expired_at: (n + 1).day.ago)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Plugin do
|
describe Plugin do
|
||||||
let(:plugin) { FactoryGirl.build(:plugin) }
|
let(:plugin) { build(:plugin) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Plugin.stub(:gemfile_path).and_return { Rails.root + "tmp/fluentd-ui-test-gemfile.plugins" }
|
Plugin.stub(:gemfile_path).and_return { Rails.root + "tmp/fluentd-ui-test-gemfile.plugins" }
|
||||||
@ -110,7 +110,7 @@ describe Plugin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "#uninstall!" do
|
describe "#uninstall!" do
|
||||||
let(:installed_plugin) { FactoryGirl.build(:plugin, gem_name: "fluent-plugin-foobar") }
|
let(:installed_plugin) { build(:plugin, gem_name: "fluent-plugin-foobar") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
installed_plugin.stub(:fluent_gem).and_return { true }
|
installed_plugin.stub(:fluent_gem).and_return { true }
|
||||||
@ -127,7 +127,7 @@ describe Plugin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "#upgrade!" do
|
describe "#upgrade!" do
|
||||||
let(:installed_plugin) { FactoryGirl.build(:plugin, gem_name: "fluent-plugin-foobar", version: current_version) }
|
let(:installed_plugin) { build(:plugin, gem_name: "fluent-plugin-foobar", version: current_version) }
|
||||||
let(:current_version) { "1.0.0" }
|
let(:current_version) { "1.0.0" }
|
||||||
let(:target_version) { "1.2.0" }
|
let(:target_version) { "1.2.0" }
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ describe Plugin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "#latest_version?" do
|
describe "#latest_version?" do
|
||||||
let(:plugin) { FactoryGirl.build(:plugin, version: gem_version.to_s) }
|
let(:plugin) { build(:plugin, version: gem_version.to_s) }
|
||||||
let(:gem_version) { Gem::Version.new("1.0.0") }
|
let(:gem_version) { Gem::Version.new("1.0.0") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe User do
|
describe User do
|
||||||
let(:user) { FactoryGirl.build(:user) }
|
let(:user) { build(:user) }
|
||||||
|
|
||||||
describe "#valid?" do
|
describe "#valid?" do
|
||||||
it { user.should be_valid }
|
it { user.should be_valid }
|
||||||
@ -13,7 +13,7 @@ describe User do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "taken name is invalid" do
|
it "taken name is invalid" do
|
||||||
another_user = FactoryGirl.create(:user)
|
another_user = create(:user)
|
||||||
user.name = another_user.name
|
user.name = another_user.name
|
||||||
user.should_not be_valid
|
user.should_not be_valid
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user