spec/models/account_spec.rb in bookingsync-engine-1.0.2 vs spec/models/account_spec.rb in bookingsync-engine-1.1.0
- old
+ new
@@ -70,10 +70,15 @@
expect(account.token.token).to eq "token"
end
end
context "when the stored token is expired" do
- self.use_transactional_fixtures = false
+ # comparing rails version, the use_transactional_fixtures only works pre 5
+ if Rails::VERSION::STRING.split(".").first.to_i >=5
+ self.use_transactional_tests = false
+ else
+ self.use_transactional_fixtures = false
+ end
let(:expires_at) { 1.day.ago.to_i.to_s }
let(:new_expires_at) { 2.days.from_now.to_i.to_s }
let(:token) { double(expired?: true, refresh!: double(token: "refreshed_token",
refresh_token: "refreshed_refresh_token", expires_at: new_expires_at)) }