Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FactoryGirl deprecation notice.

Signed-off-by: chatgris <jboyer@af83.com>
  • Loading branch information...
commit 45dcb5f3c1ef820e35e3781c7516dd05162260f4 1 parent 19e9565
chatgris authored
View
10 spec/blabbr_core/domains/post_spec.rb
@@ -2,11 +2,11 @@
require 'spec_helper'
describe BlabbrCore::Post do
- let(:current_user) { Factory :user }
- let(:topic) { Factory :topic, author: current_user }
- let!(:post) { Factory :post, author: current_user, topic: topic }
- let(:user) { Factory :user }
- let(:admin) { Factory :admin }
+ let(:current_user) { FactoryGirl.create :user }
+ let(:topic) { FactoryGirl.create :topic, author: current_user }
+ let!(:post) { FactoryGirl.create :post, author: current_user, topic: topic }
+ let(:user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
let(:domain_post) {
View
10 spec/blabbr_core/domains/posts_collection_spec.rb
@@ -2,11 +2,11 @@
require 'spec_helper'
describe BlabbrCore::PostsCollection do
- let(:current_user) { Factory :user }
- let(:topic) { Factory :topic, author: current_user }
- let!(:post) { Factory :post, author: current_user, topic: topic }
- let(:user) { Factory :user }
- let(:admin) { Factory :admin }
+ let(:current_user) { FactoryGirl.create :user }
+ let(:topic) { FactoryGirl.create :topic, author: current_user }
+ let!(:post) { FactoryGirl.create :post, author: current_user, topic: topic }
+ let(:user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
it 'it should find all posts' do
View
8 spec/blabbr_core/domains/topic_spec.rb
@@ -2,10 +2,10 @@
require 'spec_helper'
describe BlabbrCore::Topic do
- let(:current_user) { Factory :user }
- let!(:topic) { Factory :topic, author: current_user }
- let(:user) { Factory :user }
- let(:admin) { Factory :admin }
+ let(:current_user) { FactoryGirl.create :user }
+ let!(:topic) { FactoryGirl.create :topic, author: current_user }
+ let(:user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
let(:domain) {
View
8 spec/blabbr_core/domains/topics_collection_spec.rb
@@ -2,10 +2,10 @@
require 'spec_helper'
describe BlabbrCore::TopicsCollection do
- let(:current_user) { Factory :user }
- let!(:topic) { Factory :topic, author: current_user }
- let(:user) { Factory :user }
- let(:admin) { Factory :admin }
+ let(:current_user) { FactoryGirl.create :user }
+ let!(:topic) { FactoryGirl.create :topic, author: current_user }
+ let(:user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
it 'it should find all topics' do
View
6 spec/blabbr_core/domains/user_spec.rb
@@ -2,9 +2,9 @@
require 'spec_helper'
describe BlabbrCore::User do
- let!(:user) { Factory :user }
- let!(:current_user) { Factory :user }
- let(:admin) { Factory :admin }
+ let!(:user) { FactoryGirl.create :user }
+ let!(:current_user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
let(:domain) {
View
6 spec/blabbr_core/domains/users_collection_spec.rb
@@ -2,9 +2,9 @@
require 'spec_helper'
describe BlabbrCore::UsersCollection do
- let!(:user) { Factory :user }
- let!(:current_user) { Factory :user }
- let(:admin) { Factory :admin }
+ let!(:user) { FactoryGirl.create :user }
+ let!(:current_user) { FactoryGirl.create :user }
+ let(:admin) { FactoryGirl.create :admin }
context 'with a current_user' do
it 'it should find all user' do
View
10 spec/blabbr_core/lib/cerberus_spec.rb
@@ -4,9 +4,9 @@
describe BlabbrCore::Cerberus do
let(:ability) { BlabbrCore::Ability }
let(:user) { double }
- let(:current_user) { Factory :user }
- let(:topic) { Factory :topic, author: current_user }
- let(:post) { Factory :post, topic: topic, author: current_user }
+ let(:current_user) { FactoryGirl.create :user }
+ let(:topic) { FactoryGirl.create :topic, author: current_user }
+ let(:post) { FactoryGirl.create :post, topic: topic, author: current_user }
[BlabbrCore::UsersCollection, BlabbrCore::PostsCollection, BlabbrCore::TopicsCollection].each do |klass|
describe klass do
@@ -79,7 +79,7 @@
end
context 'member' do
- let(:user) { Factory :user }
+ let(:user) { FactoryGirl.create :user }
before do
topic.members.create(user: user)
@@ -145,7 +145,7 @@
end
context 'member' do
- let(:user) { Factory :user }
+ let(:user) { FactoryGirl.create :user }
before do
topic.members.create(user: user)
View
4 spec/blabbr_core/lib/limace_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlabbrCore::Limace do
- let(:topic) { Factory :topic }
+ let(:topic) { FactoryGirl.create :topic }
describe 'limace creation' do
context 'on creation' do
@@ -11,7 +11,7 @@
end
it 'should fallback on title when parameterize is nil' do
- topic = Factory :topic, title: 'でも、でも。。。'
+ topic = FactoryGirl.create :topic, title: 'でも、でも。。。'
topic.reload.limace.should eq topic.title
end
end
View
6 spec/blabbr_core/observers/post_observer_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlabbrCore::PostObserver do
- let(:post) { Factory :post }
+ let(:post) { FactoryGirl.create :post }
describe 'after_create observer' do
@@ -18,9 +18,9 @@
describe 'update_topic_members' do
before do
topic = post.topic
- topic.members.create(user: Factory(:user))
+ topic.members.create(user: FactoryGirl.create(:user))
topic.save
- Factory(:post, author: post.author, body: 'blabla', topic: post.topic)
+ FactoryGirl.create(:post, author: post.author, body: 'blabla', topic: post.topic)
end
it 'should increment members posts_count for this topic' do
View
4 spec/blabbr_core/persistence/member_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlabbrCore::Persistence::Member do
- let(:topic) { Factory :topic }
+ let(:topic) { FactoryGirl.create :topic }
describe 'Fields' do
it { should have_fields(:unread_count, :posts_count).of_type(Integer) }
@@ -16,7 +16,7 @@
describe 'validations' do
it 'should have a valid factory' do
- Factory.build(:member).should be_valid
+ FactoryGirl.build(:member).should be_valid
end
end
View
2  spec/blabbr_core/persistence/post_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlabbrCore::Persistence::Post do
- let(:post) { Factory :post }
+ let(:post) { FactoryGirl.create :post }
describe 'Fields' do
it { should have_fields(:body).of_type(String) }
View
8 spec/blabbr_core/persistence/topic_spec.rb
@@ -2,8 +2,8 @@
require 'spec_helper'
describe BlabbrCore::Persistence::Topic do
- let(:topic) { Factory :topic }
- let(:user) { Factory :user }
+ let(:topic) { FactoryGirl.create :topic }
+ let(:user) { FactoryGirl.create :user }
describe 'Fields' do
it { should have_fields(:title) }
@@ -46,8 +46,8 @@
end
describe 'pagination' do
- let!(:topic1) { Factory :topic }
- let!(:topic2) { Factory :topic, title: 'Topic 2...' }
+ let!(:topic1) { FactoryGirl.create :topic }
+ let!(:topic2) { FactoryGirl.create :topic, title: 'Topic 2...' }
it 'should be paginable' do
described_class.page.should eq [topic1, topic2]
View
6 spec/blabbr_core/persistence/user_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
describe BlabbrCore::Persistence::User do
- let(:user) { Factory :user }
+ let(:user) { FactoryGirl.create :user }
describe 'Fields' do
it { should have_fields(:email, :nickname).of_type(String) }
@@ -32,8 +32,8 @@
end
describe 'pagination' do
- let!(:user1) { Factory :user }
- let!(:user2) { Factory :user }
+ let!(:user1) { FactoryGirl.create :user }
+ let!(:user2) { FactoryGirl.create :user }
it 'should be paginable' do
described_class.page.should eq [user1, user2]
View
2  spec/factories/blabbr_core/post.rb
@@ -2,7 +2,7 @@
FactoryGirl.define do
factory :post, class: BlabbrCore::Persistence::Post do
body 'My brand new post'
- topic { Factory :topic }
+ topic { FactoryGirl.create :topic }
author { topic.author }
end
end
View
2  spec/factories/blabbr_core/topic.rb
@@ -2,6 +2,6 @@
FactoryGirl.define do
factory :topic, class: BlabbrCore::Persistence::Topic do
title 'My brand new topic'
- author { Factory :user }
+ author { FactoryGirl.create :user }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.