File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change 49
49
expect ( u . id ) . to eq ( id )
50
50
expect ( u . created_at ) . to eq ( created_at )
51
51
end
52
-
53
- it 'deletes unlocks whose conditions changed' do
54
- Unlock . refresh_unlocks ( @course , @user )
55
- @ex1 . unlock_spec = [ 'exercise ex2' ] . to_json
56
- @ex1 . save!
57
- @course . reload
58
- Unlock . refresh_unlocks ( @course , @user )
59
- expect ( Unlock . where ( exercise_name : 'ex1' ) ) . to be_empty
60
- end
61
-
62
- it 'updates unlocks whose unlock time changes' do
63
- Unlock . refresh_unlocks ( @course , @user )
64
-
65
- @ex1 . unlock_spec = [ ( Date . today + 3 . days ) . to_s ] . to_json
66
- @ex1 . save!
67
- @course . reload
68
- Unlock . refresh_unlocks ( @course , @user )
69
- u = Unlock . where ( exercise_name : 'ex1' ) . first
70
- expect ( u . valid_after ) . to be > Date . today + 2 . days
71
-
72
- @ex1 . unlock_spec = [ 'exercise ex2' ] . to_json
73
- @ex1 . save!
74
- @course . reload
75
- AwardedPoint . create! ( user_id : @user . id , course_id : @course . id , name : @available_point2 . name )
76
- Unlock . refresh_unlocks ( @course , @user )
77
- u = Unlock . where ( exercise_name : 'ex1' ) . first
78
- expect ( u . valid_after ) . to be_nil
79
- end
80
52
end
81
53
end
You can’t perform that action at this time.
0 commit comments