Skip to content

Commit 3b029ff

Browse files
committed
Mock courses.mooc.fi requests in users controller tests
1 parent a0af56b commit 3b029ff

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/site.defaults.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,8 @@ course_instruction_page: http://mooc.fi/courses/general/ohjelmointi/
138138

139139
# Teacher manual link
140140
teacher_manual_url: http://testmycode.github.io/tmc-server/usermanual/
141+
142+
# URLs for password management via courses.mooc.fi
143+
courses_mooc_fi_auth_url:
144+
courses_mooc_fi_update_password_url:
145+
courses_mooc_fi_create_user_url:

spec/controllers/users_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
password: 'xoox',
5353
password_repeat: 'xoox'
5454
}
55+
# Mock the courses.mooc.fi integration to avoid HTTP calls in tests
56+
allow_any_instance_of(User).to receive(:post_new_user_to_courses_mooc_fi).and_return(true)
5557
end
5658

5759
it 'should create a new user account' do

0 commit comments

Comments
 (0)