Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Nov 7, 2023
1 parent 3ca7d9f commit 6709a75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/controllers/repositories_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ class RepositoryGitControllerTest < ActionDispatch::IntegrationTest
@remote.update_json('echo/config.json', 'make echo private') do |config|
config.update 'access' => 'private'
end

@second_remote = local_remote('exercises/lasagna')
end

def find_echo
Expand All @@ -222,16 +224,16 @@ def find_echo
user = users(:staff)
judge = create :judge, :git_stubbed
sign_in user
post repositories_path, params: { repository: { name: 'test', remote: @remote.path, judge_id: judge.id } }
post repositories_path, params: { repository: { name: 'test', remote: @second_remote.path, judge_id: judge.id } }
end

test 'should email during repository creation' do
user = users(:staff)
judge = create :judge, :git_stubbed
sign_in user
@remote.update_file('echo/config.json', 'break config') { '(╯°□°)╯︵ ┻━┻' }
@second_remote.update_file('exercises/extra/echo/config.json', 'break config') { '(╯°□°)╯︵ ┻━┻' }
assert_difference 'ActionMailer::Base.deliveries.size', +1 do
post repositories_path, params: { repository: { name: 'test', remote: @remote.path, judge_id: judge.id } }
post repositories_path, params: { repository: { name: 'test', remote: @second_remote.path, judge_id: judge.id } }
end
end

Expand Down

0 comments on commit 6709a75

Please sign in to comment.