Reputation: 31
My code for test case
RSpec.describe "Normal days ", type: :request do
context 'User ' do
before(:all) do
DatabaseCleaner.strategy = DatabaseCleaner::NullStrategy
end
let(:user1) { create :user }
let(:user2) { create :user }
let(:user3) { create :user }
it 'Check-In ' do
check_in(user1)
end
it 'Check-Out ' do
check_out
end
it 'get histories ' do
get_histories
end
end
end
gem 'rspec'
gem 'rspec-rails'
gem 'factory_bot_rails', '5.2.0'
gem 'faker', '~> 2.22'
gem 'database_cleaner', '~> 1.5.3'
**Rails verision: **
gem 'rails', '~> 5.2.1'
ruby verision:
ruby '2.6.5'
when i run the test case then every case (means when call it class) users (user1,user2,user3) changed.
user1 = user.email => [email protected] and user.id => 1
user2 = user.email => [email protected] and user.id => 2
user3 = user.email => [email protected] and user.id => 3
user1 = user.email => [email protected] and user.id => 4
user2 = user.email => [email protected] and user.id => 5
user3 = user.email => [email protected] and user.id => 6
after run the all case user value same
user1 = user.email => [email protected] and user.id => 1
user2 = user.email => [email protected] and user.id => 2
user3 = user.email => [email protected] and user.id => 3
user1 = user.email => [email protected] and user.id => 1
user2 = user.email => [email protected] and user.id => 2
user3 = user.email => [email protected] and user.id => 3
Upvotes: 0
Views: 142