diff --git a/spec/factories/abuses.rb b/spec/factories/abuses.rb deleted file mode 100644 index 053c56201..000000000 --- a/spec/factories/abuses.rb +++ /dev/null @@ -1,10 +0,0 @@ -FactoryGirl.define do - factory :abus, :class => 'Abuse' do - signaled nil -first_name "MyString" -last_name "MyString" -email "" -message "MyText" - end - -end diff --git a/spec/factories/auth_providers.rb b/spec/factories/auth_providers.rb deleted file mode 100644 index 5825df85a..000000000 --- a/spec/factories/auth_providers.rb +++ /dev/null @@ -1,8 +0,0 @@ -FactoryGirl.define do - factory :auth_provider do - name "MyString" -type "" -status "MyString" - end - -end diff --git a/spec/factories/availabilities.rb b/spec/factories/availabilities.rb deleted file mode 100644 index 566352913..000000000 --- a/spec/factories/availabilities.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :availability do - - #end - -#end diff --git a/spec/factories/availability_tags.rb b/spec/factories/availability_tags.rb deleted file mode 100644 index db9c2dafe..000000000 --- a/spec/factories/availability_tags.rb +++ /dev/null @@ -1,7 +0,0 @@ -FactoryGirl.define do - factory :availability_tag do - availability nil -tag nil - end - -end diff --git a/spec/factories/avoirs.rb b/spec/factories/avoirs.rb deleted file mode 100644 index fee25ded1..000000000 --- a/spec/factories/avoirs.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :avoir do - - #end - -#end diff --git a/spec/factories/credits.rb b/spec/factories/credits.rb deleted file mode 100644 index 3072f8855..000000000 --- a/spec/factories/credits.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :credit do - - #end - -#end diff --git a/spec/factories/custom_assets.rb b/spec/factories/custom_assets.rb deleted file mode 100644 index 288d4dab1..000000000 --- a/spec/factories/custom_assets.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :custom_asset do - - end - -end diff --git a/spec/factories/database_providers.rb b/spec/factories/database_providers.rb deleted file mode 100644 index 2c42ffeaf..000000000 --- a/spec/factories/database_providers.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :database_provider do - - end - -end diff --git a/spec/factories/invoices.rb b/spec/factories/invoices.rb deleted file mode 100644 index c7b688824..000000000 --- a/spec/factories/invoices.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :invoice do - - #end - -#end diff --git a/spec/factories/machines.rb b/spec/factories/machines.rb deleted file mode 100644 index 22dc14da5..000000000 --- a/spec/factories/machines.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :machine do - - #end - -#end diff --git a/spec/factories/o_auth2_mappings.rb b/spec/factories/o_auth2_mappings.rb deleted file mode 100644 index 8945ae6d3..000000000 --- a/spec/factories/o_auth2_mappings.rb +++ /dev/null @@ -1,10 +0,0 @@ -FactoryGirl.define do - factory :o_auth2_mapping do - o_auth2_provider nil -resource_url "MyString" -local_field "MyString" -api_field "MyString" -data_type "MyString" - end - -end diff --git a/spec/factories/o_auth2_providers.rb b/spec/factories/o_auth2_providers.rb deleted file mode 100644 index a6c72e70b..000000000 --- a/spec/factories/o_auth2_providers.rb +++ /dev/null @@ -1,11 +0,0 @@ -FactoryGirl.define do - factory :o_auth2_provider do - base_url "MyString" -token_endpoint "MyString" -authorization_endpoint "MyString" -client_id "MyString" -client_secret "MyString" -auth_provider nil - end - -end diff --git a/spec/factories/plans.rb b/spec/factories/plans.rb deleted file mode 100644 index f1a7428aa..000000000 --- a/spec/factories/plans.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :plan do - - #end - -#end diff --git a/spec/factories/prices.rb b/spec/factories/prices.rb deleted file mode 100644 index 1c349b91b..000000000 --- a/spec/factories/prices.rb +++ /dev/null @@ -1,9 +0,0 @@ -FactoryGirl.define do - factory :price do - group nil -plan nil -priceable nil -amount 1 - end - -end diff --git a/spec/factories/profile.rb b/spec/factories/profile.rb deleted file mode 100644 index 3483e0c31..000000000 --- a/spec/factories/profile.rb +++ /dev/null @@ -1,11 +0,0 @@ -FactoryGirl.define do - sequence(:last_name) { |n| n } - - factory :profile do - first_name 'member' - last_name { FactoryGirl.generate :last_name } - gender true - birthday { 30.years.ago } - phone '0606060606' - end -end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb deleted file mode 100644 index ef4d79834..000000000 --- a/spec/factories/projects.rb +++ /dev/null @@ -1,8 +0,0 @@ -FactoryGirl.define do - sequence(:name) { |n| "project#{n}" } - - factory :project do - name { FactoryGirl.generate :name } - description { Faker::Lorem.paragraph } - end -end diff --git a/spec/factories/reservations.rb b/spec/factories/reservations.rb deleted file mode 100644 index 4cafa3f7e..000000000 --- a/spec/factories/reservations.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :reservation do - - #end - -#end diff --git a/spec/factories/stylesheets.rb b/spec/factories/stylesheets.rb deleted file mode 100644 index a581bf44c..000000000 --- a/spec/factories/stylesheets.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :stylesheet do - contents "MyString" - end - -end diff --git a/spec/factories/subscriptions.rb b/spec/factories/subscriptions.rb deleted file mode 100644 index 5d145f9c5..000000000 --- a/spec/factories/subscriptions.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :subscription do - - #end - -#end diff --git a/spec/factories/tags.rb b/spec/factories/tags.rb deleted file mode 100644 index 1cda84a6d..000000000 --- a/spec/factories/tags.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :tag do - name "MyString" - end - -end diff --git a/spec/factories/trainings.rb b/spec/factories/trainings.rb deleted file mode 100644 index 47e11f9c0..000000000 --- a/spec/factories/trainings.rb +++ /dev/null @@ -1,6 +0,0 @@ -#FactoryGirl.define do - #factory :training do - - #end - -#end diff --git a/spec/factories/user_tags.rb b/spec/factories/user_tags.rb deleted file mode 100644 index 8f8e796da..000000000 --- a/spec/factories/user_tags.rb +++ /dev/null @@ -1,7 +0,0 @@ -FactoryGirl.define do - factory :user_tag do - user nil -tag nil - end - -end diff --git a/spec/factories/users.rb b/spec/factories/users.rb deleted file mode 100644 index 2a8d75c67..000000000 --- a/spec/factories/users.rb +++ /dev/null @@ -1,14 +0,0 @@ -FactoryGirl.define do - sequence(:email) { |n| "member#{n}@sleede.com" } - sequence(:username) { |n| "member#{n}" } - - factory :user do - email { FactoryGirl.generate :email } - username { FactoryGirl.generate :username } - password 'sleede22' - password_confirmation 'sleede22' - association :profile, strategy: :build - group { Group.first } - end - -end diff --git a/spec/mailers/.keep b/spec/mailers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spec/mailers/previews/devise_mailer_preview.rb b/spec/mailers/previews/devise_mailer_preview.rb deleted file mode 100644 index d00d4411c..000000000 --- a/spec/mailers/previews/devise_mailer_preview.rb +++ /dev/null @@ -1,9 +0,0 @@ -class DeviseMailerPreview < ActionMailer::Preview - def confirmation_instructions - Devise::Mailer.confirmation_instructions(User.last, SecureRandom.hex) - end - - def reset_password_instructions - Devise::Mailer.reset_password_instructions(User.last, SecureRandom.hex) - end -end diff --git a/spec/mailers/previews/notifications_mailer_preview.rb b/spec/mailers/previews/notifications_mailer_preview.rb deleted file mode 100644 index c25687360..000000000 --- a/spec/mailers/previews/notifications_mailer_preview.rb +++ /dev/null @@ -1,7 +0,0 @@ -class NotificationsMailerPreview < ActionMailer::Preview - NotificationType::NAMES.each do |name| - define_method name do - NotificationsMailer.send_mail_by(Notification.where(notification_type_id: NotificationType.find_by_name(name)).last) - end - end -end diff --git a/spec/mailers/previews/users_mailer_preview.rb b/spec/mailers/previews/users_mailer_preview.rb deleted file mode 100644 index 9a61b3ad9..000000000 --- a/spec/mailers/previews/users_mailer_preview.rb +++ /dev/null @@ -1,5 +0,0 @@ -class UsersMailerPreview < ActionMailer::Preview - def notify_user_account_created - UsersMailer.notify_user_account_created(User.first, 'wfwwefwefsdfsdf') - end -end diff --git a/spec/models/abuse_spec.rb b/spec/models/abuse_spec.rb deleted file mode 100644 index 63525cbfc..000000000 --- a/spec/models/abuse_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Abuse, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/auth_provider_spec.rb b/spec/models/auth_provider_spec.rb deleted file mode 100644 index 176f501d9..000000000 --- a/spec/models/auth_provider_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe AuthProvider, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/availability_spec.rb b/spec/models/availability_spec.rb deleted file mode 100644 index 412931f92..000000000 --- a/spec/models/availability_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'rails_helper' - -RSpec.describe Availability, type: :model do - - describe 'create' do - it 'is success with start at, end at and type' - it 'is invalid without start at' - it 'is invalid without end at' - it 'is invalid without type' - it 'is invalid type isnt in [training, machines, event]' - it 'is invalid without training_ids when type training' - it 'is invalid without machine_ids when type machines' - end - - it 'should can associate one or many reservations' - - it 'should can destroy if dont any reservations' - - it 'should get a title' - - it 'should set a number of places' - - it 'should be completed when number of reservations equal number of places' -end diff --git a/spec/models/availability_tag_spec.rb b/spec/models/availability_tag_spec.rb deleted file mode 100644 index 3107b4b33..000000000 --- a/spec/models/availability_tag_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe AvailabilityTag, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/avoir_spec.rb b/spec/models/avoir_spec.rb deleted file mode 100644 index 85d095e97..000000000 --- a/spec/models/avoir_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'rails_helper' - -RSpec.describe Avoir, type: :model do - it 'should generate a reference after create' - - it 'is invoiced if avoir mode isnt in [stripe, cheque, transfer, none, cash]' - - it 'should can expire user subscription if avoir indicate subscription to expire' -end diff --git a/spec/models/credit_spec.rb b/spec/models/credit_spec.rb deleted file mode 100644 index 358bc728f..000000000 --- a/spec/models/credit_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.describe Credit, type: :model do - context 'training' do - it 'should is saved with plan' - end - - context 'machine' do - it 'should is saved with plan and hours' - end -end diff --git a/spec/models/custom_asset_spec.rb b/spec/models/custom_asset_spec.rb deleted file mode 100644 index 0ff1263fd..000000000 --- a/spec/models/custom_asset_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe CustomAsset, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/database_provider_spec.rb b/spec/models/database_provider_spec.rb deleted file mode 100644 index 4b43e2344..000000000 --- a/spec/models/database_provider_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe DatabaseProvider, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/invoice_spec.rb b/spec/models/invoice_spec.rb deleted file mode 100644 index 7d1a78204..000000000 --- a/spec/models/invoice_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'rails_helper' - -RSpec.describe Invoice, type: :model do - it 'should generate a reference after create' - - it 'should generate a invoice pdf' - - it 'should can build a avoir' -end diff --git a/spec/models/machine_spec.rb b/spec/models/machine_spec.rb deleted file mode 100644 index a00e0843e..000000000 --- a/spec/models/machine_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'rails_helper' - -RSpec.describe Machine, type: :model do - - describe 'create' do - it 'is success with name, image, description and spec' - it 'is invalid without name' - it 'is invalid without image' - it 'is invalid without description' - it 'is invalid without spec' - it 'should auto generate slug by name' - end - - it 'can have many machine files' - - it 'can have many projects' - - it 'can have many trainings' - - it 'should return an amount by user group' -end diff --git a/spec/models/o_auth2_mapping_spec.rb b/spec/models/o_auth2_mapping_spec.rb deleted file mode 100644 index 9022984ed..000000000 --- a/spec/models/o_auth2_mapping_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe OAuth2Mapping, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/o_auth2_provider_spec.rb b/spec/models/o_auth2_provider_spec.rb deleted file mode 100644 index 67f2cd8cd..000000000 --- a/spec/models/o_auth2_provider_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe OAuth2Provider, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/plan_spec.rb b/spec/models/plan_spec.rb deleted file mode 100644 index 9133ce664..000000000 --- a/spec/models/plan_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'rails_helper' - -RSpec.describe Plan, type: :model do - let(:group){ Group.new(name: 'groupe test', slug: SecureRandom.hex) } - - describe 'validations' do - it 'is success with amount and group' do - plan = Plan.new(amount: 500, group: group) - expect(plan).to be_valid - end - - it 'is invalid without amount' do - plan = Plan.new(group: group) - expect(plan).to be_invalid - end - - it 'is invalid without group' do - plan = Plan.new(amount: 500) - expect(plan).to be_invalid - end - end - - context "on creation" do - before :each do - @plan_id = SecureRandom.hex - @plan_name = SecureRandom.hex - allow(Stripe::Plan).to receive(:create).and_return(double(id: @plan_id, name: @plan_name)) - end - - it 'calls Stripe::Plan create method' do - plan = Plan.create(amount: 500, interval: 'month', group: group) - expect(Stripe::Plan).to have_received :create - end - - it 'saves stripe_plan.id' do - plan = Plan.create(amount: 500, interval: 'month', group: group) - expect(plan.stp_plan_id).to eq(@plan_id) - end - - it 'saves stripe_plan.name' do - plan = Plan.create(amount: 500, interval: 'month', group: group) - expect(plan.name).to eq(@plan_name) - end - end - - context "on update" do - before :each do - allow(Stripe::Plan).to receive(:create).and_return(double(id: SecureRandom.hex, name: SecureRandom.hex)) - end - - let(:plan){ Plan.create(amount: 500, interval: 'month', group: group) } - - describe "update_stripe_plan" do - it "should return false if plan already has subscriptions" do - allow(plan).to receive(:subscriptions).and_return([1,2]) - expect(plan.send(:update_stripe_plan)).to eq(false) - end - end - end -end diff --git a/spec/models/price_spec.rb b/spec/models/price_spec.rb deleted file mode 100644 index 5ce528be5..000000000 --- a/spec/models/price_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Price, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb deleted file mode 100644 index 7ba6c2523..000000000 --- a/spec/models/project_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'rails_helper' - -RSpec.describe Project, type: :model do - - describe 'create' do - it 'is success with author, name and description' - it 'is invalid without author' - it 'is invalid without name' - it 'is invalid without description' - it 'should auto generate slug by name' - end - - it 'save as draft by default' - - it 'should can published' - - it 'should have a published time after published' - - it 'can only add one project main image' - - it 'can have many project caos' - - it 'can have many machines' - - it 'can have many components' - - it 'can have many project steps' - - it 'can add a licence' -end diff --git a/spec/models/reservation_spec.rb b/spec/models/reservation_spec.rb deleted file mode 100644 index 51cbeebd6..000000000 --- a/spec/models/reservation_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'rails_helper' - -RSpec.describe Reservation, type: :model do - describe 'create' do - it 'is success with user, slots and reservable' - it 'is invalid if reservable isnt in [Training, Machine, Event]' - - it 'is success with a subscription' - - context 'stripe' do - it 'should payment success' - it 'is invalid if payment info invalid' - end - - context 'satori' do - it 'should success' - it 'is invalid if payment info invalid' - end - end - - it 'should update user credit after creation' - - it 'should create a invoice' - - it 'should can set a nb reserve places' - - it 'should can set a nb reserve reduced places' -end diff --git a/spec/models/stylesheet_spec.rb b/spec/models/stylesheet_spec.rb deleted file mode 100644 index 68291eb3b..000000000 --- a/spec/models/stylesheet_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Stylesheet, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/subscription_spec.rb b/spec/models/subscription_spec.rb deleted file mode 100644 index ffa54d5bd..000000000 --- a/spec/models/subscription_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'rails_helper' - -RSpec.describe Subscription, type: :model do - describe 'create' do - it 'is success with user, plan' - - it 'is success with a subscription' - - context 'stripe' do - it 'should payment success' - it 'is invalid if payment info invalid' - end - - context 'satori' do - it 'should success' - it 'is invalid if payment info invalid' - end - end - - it 'should reset user credit after creation' - - it 'should set a expired at after creation' - - it 'should create a invoice' - -end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb deleted file mode 100644 index 0d0fcb057..000000000 --- a/spec/models/tag_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Tag, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/training_spec.rb b/spec/models/training_spec.rb deleted file mode 100644 index b3fae28ba..000000000 --- a/spec/models/training_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rails_helper' - -RSpec.describe Training, type: :model do - - describe 'create' do - it 'is success with name' - it 'is invalid without name' - it 'should auto generate slug by name' - end - - it 'can associate many machines' - - it 'can return a user list that valided by traning' - - it 'should return an amount by user group' - - it 'should can add a number place' -end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb deleted file mode 100644 index e6fef8ef6..000000000 --- a/spec/models/user_spec.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'rails_helper' - -RSpec.describe User, type: :model do - let!(:user) { build :user } - - describe 'create' do - it 'is success if user email, gender, first name, last name, group, birthday and phone are presents' do - expect(user.save).to be true - end - - it 'is invalid when email is empty' do - user.email = nil - expect(user).to be_invalid - end - - it 'is invalid when email format invalid' do - user.email = 'this a invalid email' - expect(user).to be_invalid - end - - it 'is invalid when first name is empty' do - user.profile.first_name = nil - expect(user).to be_invalid - end - - it 'is invalid when last name is empty' do - user.profile.last_name = nil - expect(user).to be_invalid - end - - it 'is invalid when birthday is empty' do - user.profile.birthday = nil - expect(user).to be_invalid - end - - it 'is invalid when phone is empty or not numerical' do - user.profile.phone = nil - expect(user).to be_invalid - user.profile.phone = "phone" - expect(user).to be_invalid - end - - it 'is invalid when group is empty' do - user.group = nil - expect(user).to be_invalid - end - - it 'is invalid when group is empty' do - user.group = nil - expect(user).to be_invalid - end - - it 'is invalid when dont accept cgu' do - user.cgu = '0' - expect(user).to be_invalid - expect(user.errors[:cgu]).to include(I18n.t('activerecord.errors.messages.empty')) - end - end - - context 'after creation' do - it 'has a member role' do - member = create(:user) - expect(member.is_member?).to be true - end - - it 'create a stripe customer' do - member = create(:user) - allow(member).to receive(:create_stripe_customer) { |u| member.stp_customer_id = 'stripe customer id' } - member.run_callbacks(:commit) - expect(member.stp_customer_id).to eq 'stripe customer id' - end - end -end - diff --git a/spec/models/user_tag_spec.rb b/spec/models/user_tag_spec.rb deleted file mode 100644 index 11a927391..000000000 --- a/spec/models/user_tag_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe UserTag, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb deleted file mode 100644 index b4d9ec782..000000000 --- a/spec/rails_helper.rb +++ /dev/null @@ -1,50 +0,0 @@ -# This file is copied to spec/ when you run 'rails generate rspec:install' -ENV['RAILS_ENV'] ||= 'test' -require 'spec_helper' -require File.expand_path('../../config/environment', __FILE__) -require 'rspec/rails' -# Add additional requires below this line. Rails is not loaded until this point! - -# Requires supporting ruby files with custom matchers and macros, etc, in -# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are -# run as spec files by default. This means that files in spec/support that end -# in _spec.rb will both be required and run as specs, causing the specs to be -# run twice. It is recommended that you do not name files matching this glob to -# end with _spec.rb. You can configure this pattern with the --pattern -# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -# -# The following line is provided for convenience purposes. It has the downside -# of increasing the boot-up time by auto-requiring all files in the support -# directory. Alternatively, in the individual `*_spec.rb` files, manually -# require only the support files necessary. -# -Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } - -# Checks for pending migrations before tests are run. -# If you are not using ActiveRecord, you can remove this line. -ActiveRecord::Migration.maintain_test_schema! - -RSpec.configure do |config| - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - config.use_transactional_fixtures = true - - # RSpec Rails can automatically mix in different behaviours to your tests - # based on their file location, for example enabling you to call `get` and - # `post` in specs under `spec/controllers`. - # - # You can disable this behaviour by removing the line below, and instead - # explicitly tag your specs with their type, e.g.: - # - # RSpec.describe UsersController, :type => :controller do - # # ... - # end - # - # The different available types are documented in the features, such as in - # https://relishapp.com/rspec/rspec-rails/docs - config.infer_spec_type_from_file_location! -end diff --git a/spec/services/notification_center_spec.rb b/spec/services/notification_center_spec.rb deleted file mode 100644 index 424b8ca47..000000000 --- a/spec/services/notification_center_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'rails_helper' - -RSpec.describe NotificationCenter do - let(:receiver1) { create :user } - let(:receiver2) { create :user } - let(:project) { create :project } - - it 'should respond to method .call' do - expect(NotificationCenter).to respond_to(:call) - end - - it 'should create a notification' do - options = { - type: 'notify_admin_when_project_published', - receiver: receiver1, - attached_object: project - } - NotificationCenter.call(options) - expect(Notification.count).to eq 1 - end - - it 'should create same number of notifications with number of receiver' do - options = { - type: 'notify_admin_when_project_published', - receiver: [receiver1, receiver2], - attached_object: project - } - NotificationCenter.call(options) - expect(Notification.count).to eq 2 - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 38a4f9a16..000000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,87 +0,0 @@ -# This file was generated by the `rails generate rspec:install` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax - # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching - config.disable_monkey_patching! - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb deleted file mode 100644 index 4a54cd361..000000000 --- a/spec/support/database_cleaner.rb +++ /dev/null @@ -1,17 +0,0 @@ -RSpec.configure do |config| - - config.before(:suite) do - # The :transaction strategy prevents :after_commit hooks from running - DatabaseCleaner.strategy = :transaction - DatabaseCleaner.clean_with(:truncation) - # load seeds only for test - load "#{Rails.root}/db/test_seeds.rb" - end - - config.around(:each) do |example| - DatabaseCleaner.cleaning do - example.run - end - end - -end diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb deleted file mode 100644 index 43662908a..000000000 --- a/spec/support/factory_girl.rb +++ /dev/null @@ -1,12 +0,0 @@ -RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods - - config.before(:suite) do - begin - DatabaseCleaner.start - FactoryGirl.lint - ensure - DatabaseCleaner.clean - end - end -end