Skip to content

Commit 8e98ab5

Browse files
committed
Update tests to use factory traits
1 parent f0fd6a1 commit 8e98ab5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/models/activity_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,17 @@
234234

235235
describe "#calculate_credits" do
236236
it "should use initial credit value" do
237-
activity = create(:activity, credit: 50, duration_in_hours: 2.5)
237+
activity = create(:activity, :with_duration, credit: 50)
238238
expect(activity.credit).to eq(50)
239239
end
240240

241241
it "calculates the correct credits from duration in hours" do
242-
activity = create(:activity, :activity_no_credits, duration_in_hours: 2.5)
242+
activity = create(:activity, :with_duration, :activity_no_credits)
243243
expect(activity.credit).to eq(25)
244244
end
245245

246246
it "should not change credit amount if no duration in hours" do
247-
activity = create(:activity, credit: 50, duration_in_hours: nil)
247+
activity = create(:activity, credit: 50)
248248
expect(activity.credit).to eq(50)
249249
end
250250

0 commit comments

Comments
 (0)