Skip to content

Commit

Permalink
add test from on_moderate
Browse files Browse the repository at this point in the history
  • Loading branch information
usernaimandrey committed Dec 19, 2024
1 parent 73f11ee commit 071a042
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/controllers/web/account/vacancies_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,19 @@ class Web::Account::VacanciesControllerTest < ActionDispatch::IntegrationTest

assert { published_vacancy.title != attrs[:title] }
end

test '#send_to_moderate' do
vacancy = vacancies(:draft_full)
attrs = FactoryBot.attributes_for(:vacancy)
params = {
on_moderate: true,
vacancy: attrs
}

patch(account_vacancy_path(vacancy), params:)
vacancy.reload

assert_redirected_to account_vacancies_path
assert { vacancy.on_moderate? }
end
end
7 changes: 7 additions & 0 deletions test/fixtures/vacancies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,10 @@ over_month_old:
title: Фронтендер
salary_to: 2000
published_at: <%= 2.month.ago.to_fs(:db) %>

draft_full:
<<: *DEFAULTS
title: Draft
state: idle
salary_from: 1000
salary_to: 2000

0 comments on commit 071a042

Please sign in to comment.