From 2da8268dd7171366ea2f7dacbca292a87020a10c Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Thu, 30 Jul 2015 14:01:49 -0300 Subject: [PATCH] Revert "Added seeds script to set the default configurations to public" --- db/seeds.rb | 19 ------------------- spec/controllers/users_controller_spec.rb | 2 +- spec/factories/users.rb | 11 ++--------- spec/models/reading_group_spec.rb | 2 +- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 5d02a42..4edb1e8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,22 +5,3 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) - -# Default mezuro user, the owner of the public kalibro configurations -password = Devise.friendly_token -default_user = FactoryGirl.create(:mezuro_user, password: password) - -puts "-- Default user created:" -puts " Email: #{default_user.email}" -puts " Password: #{password}" - -# The database should have only the default public -# configurations when this file is executed -kalibro_configurations = KalibroConfiguration.all -kalibro_configurations.each do |configuration| - attributes = KalibroConfigurationAttributes.new - attributes.kalibro_configuration_id = configuration.id - attributes.public = true - attributes.user_id = default_user.id - attributes.save -end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 71dacc3..189d8e1 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe UsersController, :type => :controller do describe 'projects' do - let(:user) { FactoryGirl.build(:user, :with_id) } + let(:user) { FactoryGirl.build(:user) } before :each do User.expects(:find).with(user.id).returns(user) diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 47bf262..eec29f8 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -2,23 +2,16 @@ FactoryGirl.define do factory :user do + id 1 name "Diego Martinez" email "diego@email.com" password "password" factory :another_user do + id 2 name "Heitor Reis" email "hr@email.com" password "password" end - - factory :mezuro_user do - name "Mezuro Default user" - email "mezuro@librelist.com" - end - - trait :with_id do - sequence(:id, 1) - end end end diff --git a/spec/models/reading_group_spec.rb b/spec/models/reading_group_spec.rb index d4fe15d..584fd4c 100644 --- a/spec/models/reading_group_spec.rb +++ b/spec/models/reading_group_spec.rb @@ -76,7 +76,7 @@ describe ReadingGroup, :type => :model do describe 'class methods' do describe 'public_or_owned_by_user' do - let!(:user) { FactoryGirl.build(:user, :with_id) } + let!(:user) { FactoryGirl.build(:user) } let!(:owned_private_attrs) { FactoryGirl.build(:reading_group_attributes, :private, user_id: user.id) } let!(:owned_public_attrs) { FactoryGirl.build(:reading_group_attributes, user_id: user.id) } -- libgit2 0.21.2