source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/api/v1/documents_controller_test.rb
Ruby
mit
45
main
1,661
# frozen_string_literal: true require "test_helper" class API::V1::DocumentsControllerTest < ActionDispatch::IntegrationTest test "should create candidate" do sign_in accounts(:admin_account) url = "https://www.linkedin.com/in/username/" full_name = "Sam Smith" cv = fixture_file_upload("empty.pdf",...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/scorecard_templates_controller_test.rb
Ruby
mit
45
main
6,458
# frozen_string_literal: true require "test_helper" class ATS::ScorecardTemplatesControllerTest < ActionDispatch::IntegrationTest setup do sign_in accounts(:employee_account) end test "should compose the new scorecard_template" do position_stage = position_stages(:ruby_position_contacted) assert_n...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/candidates_controller_test.rb
Ruby
mit
45
main
31,500
# frozen_string_literal: true require "test_helper" class ATS::CandidatesControllerTest < ActionDispatch::IntegrationTest setup do @current_account = accounts(:employee_account) sign_in @current_account end test "should get index" do get ats_candidates_url assert_response :success end tes...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/scorecards_controller_test.rb
Ruby
mit
45
main
8,465
# frozen_string_literal: true require "test_helper" class ATS::ScorecardssControllerTest < ActionDispatch::IntegrationTest setup do sign_in accounts(:employee_account) end test "should compose the new scorecard" do position_stage = position_stages(:ruby_position_contacted) placement = placements(:s...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/quick_search_controller_test.rb
Ruby
mit
45
main
2,883
# frozen_string_literal: true require "test_helper" class ATS::QuickSearchControllerTest < ActionDispatch::IntegrationTest test "fetch candidates by admin account" do sign_in accounts(:admin_account) t1 = Time.zone.now t2 = t1.yesterday candidate1 = candidates(:jake) candidate2 = candidat...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/compose_controller_test.rb
Ruby
mit
45
main
3,866
# frozen_string_literal: true require "test_helper" class ATS::ComposeControllerTest < ActionDispatch::IntegrationTest setup do @current_account = accounts(:employee_account) sign_in @current_account end test "should get new compose form" do get new_ats_compose_path(params: { candidate_id: candidat...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/members_controller_test.rb
Ruby
mit
45
main
6,425
# frozen_string_literal: true require "test_helper" class ATS::MembersControllerTest < ActionDispatch::IntegrationTest setup do sign_in accounts(:admin_account) end test "should get team page and show invite modal" do get ats_team_path assert_response :success get invite_modal_ats_members_pat...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/position_stages_controller_test.rb
Ruby
mit
45
main
1,722
# frozen_string_literal: true require "test_helper" class ATS::PositionStagesControllerTest < ActionDispatch::IntegrationTest test "should allow to destroy position stage to admins" do sign_in accounts(:admin_account) position_stage = position_stages(:golang_position_verified) assert_not position_stage...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/dashboard_controller_test.rb
Ruby
mit
45
main
269
# frozen_string_literal: true require "test_helper" class ATS::CandidatesControllerTest < ActionDispatch::IntegrationTest setup do sign_in accounts(:admin_account) end test "should get dashboard" do get root_url assert_response :success end end
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/tasks_controller_test.rb
Ruby
mit
45
main
1,193
# frozen_string_literal: true require "test_helper" class ATS::TasksControllerTest < ActionDispatch::IntegrationTest test "should render new modal for each taskable type" do sign_in accounts(:employee_account) candidate = candidates(:john) get new_modal_ats_tasks_url(params: { taskable_id: candidate.id...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/ats/placements_test.rb
Ruby
mit
45
main
527
# frozen_string_literal: true require "test_helper" class ATS::PlacementsControllerTest < ActionDispatch::IntegrationTest setup do @current_account = accounts(:employee_account) sign_in @current_account end test "fetch_pipeline_placements should work" do get ats_position_fetch_pipeline_placements_p...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/career_site/positions_controller_test.rb
Ruby
mit
45
main
5,187
# frozen_string_literal: true require "test_helper" class CareerSite::PositionsControllerTest < ActionDispatch::IntegrationTest include Dry::Monads[:result] test "apply should create candidate, placement and task and assign recruiter if career_site_enabled is true" do position = positions(:ruby_position) ...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/settings/personal/profiles_controller_test.rb
Ruby
mit
45
main
2,205
# frozen_string_literal: true require "test_helper" class Settings::Personal::ProfilesControllerTest < ActionDispatch::IntegrationTest test "should open personal profile settings" do sign_in accounts(:interviewer_account) get settings_personal_profile_path assert_response :success end test "shoul...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/settings/recruitment/email_templates_controller_test.rb
Ruby
mit
45
main
2,789
# frozen_string_literal: true require "test_helper" class Settings::Recruitment::EmailTemplatesControllerTest < ActionDispatch::IntegrationTest test "should open email templates recruitment settings for admin" do sign_in accounts(:admin_account) get settings_recruitment_email_templates_path assert_res...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/settings/recruitment/sources_controller_test.rb
Ruby
mit
45
main
2,831
# frozen_string_literal: true require "test_helper" class Settings::Recruitment::SourcesControllerTest < ActionDispatch::IntegrationTest setup do @current_account = accounts(:admin_account) sign_in @current_account end test "should open sources recruitment settings" do get settings_recruitment_sour...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/settings/recruitment/disqualify_reasons_controller_test.rb
Ruby
mit
45
main
3,899
# frozen_string_literal: true require "test_helper" class Settings::Recruitment::DisqualifyReasonsControllerTest < ActionDispatch::IntegrationTest setup do @current_account = accounts(:admin_account) sign_in @current_account end test "should open disqualify reasons recruitment settings" do get sett...
github
freeats/freeats
https://github.com/freeats/freeats
test/controllers/settings/company/general_profiles_controller_test.rb
Ruby
mit
45
main
1,113
# frozen_string_literal: true require "test_helper" class Settings::Company::GeneralProfilesControllerTest < ActionDispatch::IntegrationTest test "should open general company settings" do sign_in accounts(:admin_account) get settings_company_general_path assert_response :success end test "should ...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/button_component_test.rb
Ruby
mit
45
main
420
# frozen_string_literal: true require "test_helper" class ButtonComponentTest < ViewComponent::TestCase test "default button component" do assert_equal( render_inline(ButtonComponent.new.with_content("Button")).to_html, %(<button class="btn d-inline-flex gap-2 align-items-center text-nowrap ...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/button_link_component_test.rb
Ruby
mit
45
main
431
# frozen_string_literal: true require "test_helper" class ButtonLinkComponentTest < ViewComponent::TestCase test "default button link component" do assert_equal( render_inline(ButtonLinkComponent.new("#").with_content("ButtonLink")).to_html, %(<a class="btn d-inline-flex gap-2 align-items-center ...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/text_input_component_test.rb
Ruby
mit
45
main
1,533
# frozen_string_literal: true require "test_helper" class TextInputComponentTest < ViewComponent::TestCase test "text field tag" do assert_equal( render_inline(TextInputComponent.new("name")).to_html, "<input type=\"text\" name=\"name\" id=\"name\" " \ "class=\"form-control text-input-componen...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/labeled_component_preview.rb
Ruby
mit
45
main
1,494
# frozen_string_literal: true class LabeledComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [small, medium] } def show_card_row(size: :medium) view_content_size = { small: "-sm", medium: "" }[size] render(LabeledComponent.new(right_class: "col-form-label#{view_...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/button_component_preview.rb
Ruby
mit
45
main
2,940
# frozen_string_literal: true class ButtonComponentPreview < ViewComponent::Preview # @param content text # @param icon_name text # @param size select { choices: [tiny, small, medium] } # @param icon_type select { choices: [outline, filled] } # @param disabled toggle # @param icon_position select { choices...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/pill_select_component_preview.rb
Ruby
mit
45
main
3,819
# frozen_string_literal: true class PillSelectComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [tiny, small, medium] } # @param options text description "Use ', ' to separate options" # @param disabled_options text description "Use ', ' to separate options" # @para...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/single_select_component_preview.rb
Ruby
mit
45
main
3,919
# frozen_string_literal: true class SingleSelectComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [tiny, small, medium] } # @param options text description "Use ', ' to separate options" # @param disabled_options text description "Use ', ' to separate options" # @pa...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/html_select_component_preview.rb
Ruby
mit
45
main
3,049
# frozen_string_literal: true class HtmlSelectComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [tiny, small, medium] } # @param placeholder text def local(size: :medium, placeholder: local_placeholder) render( HtmlSelectComponent.new( "name", ...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/button_link_component_preview.rb
Ruby
mit
45
main
3,006
# frozen_string_literal: true class ButtonLinkComponentPreview < ViewComponent::Preview # @param content text # @param icon_name text # @param size select { choices: [tiny, small, medium] } # @param icon_type select { choices: [outline, filled] } # @param disabled toggle # @param icon_position select { cho...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/multiple_select_component_preview.rb
Ruby
mit
45
main
3,847
# frozen_string_literal: true class MultipleSelectComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [tiny, small, medium] } # @param options text description "Use ', ' to separate options" # @param disabled_options text description "Use ', ' to separate options" # @...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/text_input_component_preview.rb
Ruby
mit
45
main
1,461
# frozen_string_literal: true class TextInputComponentPreview < ViewComponent::Preview # @!group Variants # @param size select { choices: [tiny, small, medium] } # @param value text # @param placeholder text # @param subscript text # rubocop:disable Lint/UnusedMethodArgument def default(size: :medium, va...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/icon_button_component_preview.rb
Ruby
mit
45
main
633
# frozen_string_literal: true class IconButtonComponentPreview < ViewComponent::Preview # @param tabler_icon_name text # @param icon_type select { choices: [outline, filled] } # @param size select { choices: [tiny, small, medium] } # @!group Variants def default_variant(tabler_icon_name: :pointer, icon_type:...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/pretty_number_component_preview.rb
Ruby
mit
45
main
1,353
# frozen_string_literal: true class PrettyNumberComponentPreview < ViewComponent::Preview # @!group Variants def simple_number render PrettyNumberComponent.new(123_456_789, html: false) end # @param to def range(to: 987_654.321) render PrettyNumberComponent.new(123_456_789, to:, html: false) end ...
github
freeats/freeats
https://github.com/freeats/freeats
test/components/previews/icon_component_preview.rb
Ruby
mit
45
main
369
# frozen_string_literal: true class IconComponentPreview < ViewComponent::Preview # @param tabler_icon_name text # @param type select { choices: [outline, filled] } # @param size select { choices: [tiny, small, medium] } def icon(tabler_icon_name: :pointer, type: :outline, size: :small) render(IconComponen...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/account_link_test.rb
Ruby
mit
45
main
5,877
# frozen_string_literal: true require "test_helper" class AccountLinkTest < ActiveSupport::TestCase test "normalize method should work" do github_link = AccountLink.new( "http://subdomain.GitHub.com/UserName/?utf8=✓&tab=repositories&q=query&type=&language=" ) linkedin_link = AccountLink.new("http:...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/imap/message_body_test_helper.rb
Ruby
mit
45
main
1,133
# frozen_string_literal: true # rubocop:disable Layout/LineLength module MessageBodyTestHelper SIMPLE_MESSAGE_PLAIN_BODY = <<~TEXT Stefan Hammond Software Developer at ACME <https://www.example.com/?utm_campaign=hammond&utm_medium=email&utm_source=email> TEXT SIMPLE_MESSAGE_HTML_BODY = "<div dir=...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/imap/account_test.rb
Ruby
mit
45
main
774
# frozen_string_literal: true require "test_helper" require "minitest/mock" class ImapAccountTest < ActiveSupport::TestCase test "imap_service should retry to fetch access token if it fails" do WebMock.reset! oauth_client_mock = Minitest::Mock.new 4.times do oauth_client_mock.expect :fetch_access_...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/imap/imap_test_helper.rb
Ruby
mit
45
main
14,978
# frozen_string_literal: true require "mail" require_relative "message_body_test_helper" # rubocop:disable Layout/LineLength module ImapTestHelper BLANK_AUTOREPLY_HEADERS = { auto_submitted: "", x_autoreply: "", x_autorespond: "", precedence: "", x_precedence: "", x_auto_response_suppress: "...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/imap/message_test.rb
Ruby
mit
45
main
9,697
# frozen_string_literal: true require "test_helper" require "minitest/mock" require "./test/lib/imap/imap_test_helper" class ImapMessageTest < ActiveSupport::TestCase include ImapTestHelper ITH = ImapTestHelper setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) end test "should parse m...
github
freeats/freeats
https://github.com/freeats/freeats
test/lib/rubocop/cop/minitest/literal_as_expected_argument_test.rb
Ruby
mit
45
main
2,767
# frozen_string_literal: true require "test_helper" require "rubocop-minitest" require "rubocop/minitest/assert_offense" require "./lib/rubocop/cop/minitest/literal_as_expected_argument" class LiteralAsExpectedArgumentTest < ActiveSupport::TestCase include RuboCop::Minitest::AssertOffense setup do @cop = ::R...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/email_synchronization/retrieve_gmail_tokens_test.rb
Ruby
mit
45
main
4,858
# frozen_string_literal: true require "test_helper" class EmailSynchronization::RetrieveGmailTokensTest < ActiveSupport::TestCase include Dry::Monads[:result] teardown do Faraday.default_connection = nil end test "should fetch different email and return failure" do stubs = Faraday::Adapter::Test::St...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/email_synchronization/synchronize_test.rb
Ruby
mit
45
main
2,417
# frozen_string_literal: true require "test_helper" require_relative "../../lib/imap/imap_test_helper" class EmailSynchronization::SynchronizeTest < ActiveSupport::TestCase include Dry::Monads[:result] ITH = ImapTestHelper test "should work with only_for_email_addresses" do message_list = [ITH::PARSED_CAN...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/email_synchronization/process_single_message_test.rb
Ruby
mit
45
main
2,359
# frozen_string_literal: true require "test_helper" require_relative "../../lib/imap/imap_test_helper" class EmailSynchronization::ProcessSingleMessageTest < ActiveSupport::TestCase include Dry::Monads[:result] ITH = ImapTestHelper setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) end ...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/email_synchronization/process_single_message/create_from_imap_test.rb
Ruby
mit
45
main
2,109
# frozen_string_literal: true require "test_helper" class EmailSynchronization::ProcessSingleMessage::CreateFromImapTest < ActiveSupport::TestCase include Dry::Monads[:result] include ActionMailer::TestHelper setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) @tested_class = EmailSynchro...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/scorecard_templates/destroy_test.rb
Ruby
mit
45
main
2,152
# frozen_string_literal: true require "test_helper" class ScorecardTemplates::DestroyTest < ActiveSupport::TestCase test "should destroy scorecard_template, its associated events and questions" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) actor_account = accounts(:admin_account) scorecard...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/placements/change_status_test.rb
Ruby
mit
45
main
3,503
# frozen_string_literal: true require "test_helper" class Placement::ChangeStatusTest < ActiveSupport::TestCase setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) end test "should change status, create event and assign disqualify_reason" do placement = placements(:sam_golang_replied) ...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/scorecards/change_test.rb
Ruby
mit
45
main
2,559
# frozen_string_literal: true require "test_helper" class Scorecards::ChangeTest < ActiveSupport::TestCase test "should update scorecard and create event" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) scorecard = scorecards(:ruby_position_replied_scorecard) actor_account = accounts(:admin_...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/scorecards/destroy_test.rb
Ruby
mit
45
main
1,855
# frozen_string_literal: true require "test_helper" class Scorecards::DestroyTest < ActiveSupport::TestCase test "should destroy scorecard, its associated events and questions" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) actor_account = accounts(:admin_account) scorecard = scorecards(:ru...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/candidates/upload_file_test.rb
Ruby
mit
45
main
6,030
# frozen_string_literal: true require "test_helper" class Candidates::UploadFileTest < ActionDispatch::IntegrationTest setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) @empty_pdf_file = ActionDispatch::Http::UploadedFile.new( filename: "empty.pdf", type: "application/pdf", ...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/candidates/apply_test.rb
Ruby
mit
45
main
6,054
# frozen_string_literal: true require "test_helper" class Candidates::ApplyTest < ActionDispatch::IntegrationTest include Dry::Monads[:result] setup do @file = ActionDispatch::Http::UploadedFile.new( filename: "empty.pdf", type: "application/pdf", tempfile: Rails.root.join("test/fixtures/fi...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/candidates/merge_test.rb
Ruby
mit
45
main
19,927
# frozen_string_literal: true require "test_helper" class Candidates::MergeTest < ActiveSupport::TestCase include Dry::Monads[:result] setup do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) @candidate = candidates(:john) @candidate_duplicate = candidates(:john_duplicate) @actor_account...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/candidates/update_from_cv_test.rb
Ruby
mit
45
main
3,433
# frozen_string_literal: true require "test_helper" class Candidates::UpdateFromCVTest < ActionDispatch::IntegrationTest test "should update nothing from empty file" do candidate = candidates(:john) old_links = candidate.links old_phones = candidate.phones old_emails = candidate.all_emails cv_f...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/position_stages/delete_test.rb
Ruby
mit
45
main
4,384
# frozen_string_literal: true require "test_helper" class PositionStages::DeleteTest < ActiveSupport::TestCase test "should mark position_stage as deleted; update list_index for other position's stages; " \ "create position_stage_removed event associated with position; " \ "delete scorecard_template a...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/tasks/add_test.rb
Ruby
mit
45
main
3,330
# frozen_string_literal: true require "test_helper" class Tasks::AddTest < ActiveSupport::TestCase test "should add task and create events" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) actor_account = accounts(:employee_account) name = "Test task" due_date = 1.day.from_now.to_date ...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/tasks/change_test.rb
Ruby
mit
45
main
3,156
# frozen_string_literal: true require "test_helper" class Tasks::ChangeTest < ActiveSupport::TestCase test "should add and remove task watchers" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) actor_account = accounts(:employee_account) task = tasks(:no_taskable) old_watcher = members(:e...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/tasks/change_status_test.rb
Ruby
mit
45
main
690
# frozen_string_literal: true require "test_helper" class Tasks::ChangeStatusTest < ActiveSupport::TestCase test "closing repeated task should reopen it and change due date" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) task = tasks(:position) assert_equal task.due_date, Time.zone.today ...
github
freeats/freeats
https://github.com/freeats/freeats
test/operations/settings/recruitment/sources/change_test.rb
Ruby
mit
45
main
1,616
# frozen_string_literal: true require "test_helper" class Settings::Recruitment::Sources::ChangeTest < ActionDispatch::IntegrationTest include Dry::Monads[:result] test "should return linkedin_source_cannot_be_changed" do ActsAsTenant.current_tenant = tenants(:toughbyte_tenant) other_source = candidate_s...
github
freeats/freeats
https://github.com/freeats/freeats
test/grids/ats/candidates_grid_test.rb
Ruby
mit
45
main
8,144
# frozen_string_literal: true require "test_helper" class ATS::CandidatesGridTest < ActiveSupport::TestCase test "scope should get not merged candidates" do candidate = candidates(:john) duplicate_candidate = candidates(:john_duplicate) duplicate_candidate.update!(merged_to: candidate.id) grid_asse...
github
freeats/freeats
https://github.com/freeats/freeats
test/grids/ats/positions_grid_test.rb
Ruby
mit
45
main
2,838
# frozen_string_literal: true require "test_helper" class ATS::PositionsGridTest < ActiveSupport::TestCase test "name filter should work" do relevant_position = positions(:ruby_position) other_position = positions(:golang_position) grid_assets = ATS::PositionsGrid.new(name: relevant_position.name...
github
freeats/freeats
https://github.com/freeats/freeats
test/channels/application_cable/connection_test.rb
Ruby
mit
45
main
400
# frozen_string_literal: true require "test_helper" # rubocop:disable Style/ClassAndModuleChildren module ApplicationCable class ConnectionTest < ActionCable::Connection::TestCase # test "connects with cookies" do # cookies.signed[:user_id] = 42 # # connect # # assert_equal connection....
github
freeats/freeats
https://github.com/freeats/freeats
test/validation_schemas/email_message_schema_test.rb
Ruby
mit
45
main
478
# frozen_string_literal: true require "test_helper" class EmailMessageSchemaTest < ActiveSupport::TestCase include EmailRegexp test "EMAIL_ADDRESS_REGEX should work" do valid_emails = [ "smith@gmail.com" ] invalid_emails = [ "<smith@gmail.com>", "Jake Smith" ] valid_emails....
github
freeats/freeats
https://github.com/freeats/freeats
test/lint/eslint_test.rb
Ruby
mit
45
main
712
# frozen_string_literal: true require "test_helper" class EslintTest < ActiveSupport::TestCase test "check all files with eslint" do next if ENV["CI"].present? modified = `git diff --name-only origin/main '*.js'` untracked = `git ls-files --others --exclude-standard '*.js'` deleted = `git diff --d...
github
freeats/freeats
https://github.com/freeats/freeats
test/lint/prettier_test.rb
Ruby
mit
45
main
246
# frozen_string_literal: true require "test_helper" class PrettierTest < ActiveSupport::TestCase test "check all files with prettier" do next if ENV["CI"].present? assert_empty `node_modules/prettier/bin/prettier.cjs -l .` end end
github
freeats/freeats
https://github.com/freeats/freeats
test/lint/slim_lint_test.rb
Ruby
mit
45
main
639
# frozen_string_literal: true require "test_helper" class SlimLintTest < ActiveSupport::TestCase test "check all files with slim-lint" do next if ENV["CI"].present? modified = `git diff --name-only origin/main '*.slim'` untracked = `git ls-files --others --exclude-standard '*.slim'` deleted = `git...
github
freeats/freeats
https://github.com/freeats/freeats
test/lint/rubocop_test.rb
Ruby
mit
45
main
681
# frozen_string_literal: true require "test_helper" class RubocopTest < ActiveSupport::TestCase test "check all files with rubocop" do next if ENV["CI"].present? modified = `git diff --name-only origin/main '*.rb' '*.rake'` untracked = `git ls-files --others --exclude-standard --exclude='vendor/**/*' '...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/member_note_mailer_test.rb
Ruby
mit
45
main
3,773
# frozen_string_literal: true require "test_helper" class MemberNoteMailerTest < ActionMailer::TestCase setup do @reply_to = "doreply@example.com" end test "should send an email about the creation of the note" do current_account = accounts(:admin_account) to = members(:helen_member) note = notes...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/member_invite_mailer_test.rb
Ruby
mit
45
main
688
# frozen_string_literal: true require "test_helper" class MemberInviteMailerTest < ActionMailer::TestCase setup do @reply_to = "doreply@example.com" end test "should send an email with invitation" do actor_account = accounts(:admin_account) to = "smith.j@gmail.com" invite_token = Random.urlsafe_...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/email_message_mailer_test.rb
Ruby
mit
45
main
935
# frozen_string_literal: true require "test_helper" class EmailMessageMailerTest < ActionMailer::TestCase test "should send an email" do email_message_params = { reply_to: Member.all.sample.email_address, from: "notifications@freeats.com", to: "candidate@email.com", cc: "manager@mail.com...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/previews/email_message_mailer_preview.rb
Ruby
mit
45
main
493
# frozen_string_literal: true # Preview all emails at http://localhost:3000/rails/mailers/member_note_mailer class EmailMessageMailerPreview < ActionMailer::Preview def send_email EmailMessageMailer.with( reply_to: Member.all.sample.email_address, from: "notifications@freeats.com", to: "candida...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/previews/member_invite_mailer_preview.rb
Ruby
mit
45
main
655
# frozen_string_literal: true # Preview all emails at http://localhost:3000/rails/mailers/ class MemberInviteMailerPreview < ActionMailer::Preview def invitation invite_token = Random.urlsafe_base64(30) to = Faker::Internet.email actor_account = Account.all.sample AccessToken.create!( tenant: T...
github
freeats/freeats
https://github.com/freeats/freeats
test/mailers/previews/member_note_mailer_preview.rb
Ruby
mit
45
main
1,289
# frozen_string_literal: true # Preview all emails at http://localhost:3000/rails/mailers/member_note_mailer class MemberNoteMailerPreview < ActionMailer::Preview def created MemberNoteMailer.with( current_account: Account.first, note: Note.first, to: ).created end def mentioned Me...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/icon_button_component.rb
Ruby
mit
45
main
1,946
# frozen_string_literal: true class IconButtonComponent < IconComponent ICON_BUTTON_VARIANTS = %w[ default ghost ].freeze SIZE_CLASSES = { tiny: "icon-tiny", small: "icon-small", medium: "icon-medium", large: "icon-large" }.freeze option :href, Types::Strict::Hash.schema( ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/labeled_component.rb
Ruby
mit
45
main
2,267
# frozen_string_literal: true class LabeledComponent < ApplicationComponent renders_one :label, "LabelComponent" class LabelComponent < ApplicationComponent SIZE_CLASSES = { small: "label-component-small col-form-label-sm", medium: "label-component-medium col-form-label" }.freeze param :t...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/icon_component.rb
Ruby
mit
45
main
1,024
# frozen_string_literal: true class IconComponent < ApplicationComponent include TablerIcons ICON_SIZE_CLASS = { tiny: "icon-component-tiny", small: "icon-component-small", medium: "icon-component-medium", large: "icon-component-large" }.freeze param :icon_name, Types::Coercible::String opt...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/pill_select_component.rb
Ruby
mit
45
main
1,476
# frozen_string_literal: true class PillSelectComponent < SelectComponent option :include_hidden, Types::Strict::Bool, default: -> { false } option :allow_create_new_option, Types::Strict::Bool, default: -> { false } def call common_options = { id: compose_id, multiple: true, placeholder:,...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/pretty_number_component.rb
Ruby
mit
45
main
2,027
# frozen_string_literal: true class PrettyNumberComponent < ApplicationComponent include ActionView::Helpers::NumberHelper param :number, Types::Strict::Integer | Types::Strict::Float | Types::Strict::String.optional option :to, Types::Strict::Integer | Types::Strict::Float | Types::Strict::String.optional, ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/html_select_component.rb
Ruby
mit
45
main
2,554
# frozen_string_literal: true # Rails do not allow the rendering of rich text in the dropdown menu or in the selected options. # We have to pass the rich text as a string to the stimulus controller and parse it there. class HtmlSelectComponent < SelectComponent # This option is used to define how we want to render t...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/multiple_select_component.rb
Ruby
mit
45
main
1,632
# frozen_string_literal: true class MultipleSelectComponent < SelectComponent option :include_hidden, Types::Strict::Bool, default: -> { false } option :required, Types::Strict::Bool, default: -> { false } option :instant_submit, Types::Strict::Bool, default: -> { false } def call common_options = { ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/button_link_component.rb
Ruby
mit
45
main
837
# frozen_string_literal: true class ButtonLinkComponent < ButtonComponent param :href, Types::Strict::String option :target, Types::Symbol.enum(:_self, :_blank, :_parent, :_top), optional: true option :type, optional: true def call link_content = link_to( href, class: [ DEF...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/select_component.rb
Ruby
mit
45
main
3,588
# frozen_string_literal: true # This component does not render anything on its own. # It is used as a base class for other select components. class SelectComponent < ApplicationComponent SIZE_CLASSES = { tiny: "tiny", small: "small", medium: "medium" }.freeze BUTTON_GROUP_SIZE_CLASSES = { tiny:...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/application_component.rb
Ruby
mit
45
main
476
# frozen_string_literal: true class ApplicationComponent < ViewComponent::Base extend Dry::Initializer option :additional_options, Types::Strict::Hash, optional: true # Extracts keyword arguments that are not initialized via "option" # and stores them in "additional_options". def initialize(*, **kwargs) ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/button_component.rb
Ruby
mit
45
main
2,619
# frozen_string_literal: true class ButtonComponent < ApplicationComponent renders_one :icon, "InnerIconComponent" class InnerIconComponent < IconComponent ICON_POSITION = { left: "", right: "order-last" }.freeze option :position, Types::Symbol.enum(*ICON_POSITION.keys), ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/text_input_component.rb
Ruby
mit
45
main
2,915
# frozen_string_literal: true class TextInputComponent < ApplicationComponent renders_one :subscript, "SubscriptComponent" class SubscriptComponent < ApplicationComponent param :text, Types::Strict::String option :id, Types::Strict::String, optional: true, default: -> { SecureRandom.alphanumeric(10) } ...
github
freeats/freeats
https://github.com/freeats/freeats
app/components/single_select_component.rb
Ruby
mit
45
main
1,767
# frozen_string_literal: true class SingleSelectComponent < SelectComponent option :include_blank, Types::Strict::Bool | Types::Strict::String, default: -> { false } option :required, Types::Strict::Bool, default: -> { false } def call common_options = { id: compose_id, disabled:, placehol...
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/application_policy.rb
Ruby
mit
45
main
951
# frozen_string_literal: true class ApplicationPolicy < ActionPolicy::Base include ActionPolicy::Policy::Core include ActionPolicy::Policy::Authorization include ActionPolicy::Policy::PreCheck include ActionPolicy::Policy::Reasons include ActionPolicy::Policy::Aliases include ActionPolicy::Policy::Scoping ...
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/note_policy.rb
Ruby
mit
45
main
229
# frozen_string_literal: true class NotePolicy < ApplicationPolicy alias_rule :show_edit_view?, to: :update? def update? member.id == record.member_id end def destroy? update? || available_for_admin? end end
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/ats/scorecard_policy.rb
Ruby
mit
45
main
227
# frozen_string_literal: true class ATS::ScorecardPolicy < ApplicationPolicy def destroy? available_for_admin? || scorecard_creator? end private def scorecard_creator? record.author.id == member.id end end
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/ats/placement_policy.rb
Ruby
mit
45
main
311
# frozen_string_literal: true class ATS::PlacementPolicy < ApplicationPolicy def destroy? available_for_admin? || placement_creator? end private def placement_creator? return false unless record.added_event.actor_account record.added_event.actor_account.member.id == member.id end end
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/settings/company/career_site_policy.rb
Ruby
mit
45
main
224
# frozen_string_literal: true class Settings::Company::CareerSitePolicy < ApplicationPolicy # TODO: Functionality in the process of implementation. def show? Rails.env.development? && available_for_admin? end end
github
freeats/freeats
https://github.com/freeats/freeats
app/policies/settings/personal/profile_policy.rb
Ruby
mit
45
main
246
# frozen_string_literal: true class Settings::Personal::ProfilePolicy < ApplicationPolicy # Not all users will want to link their email accounts, # so for now we have decided to hide this functionality. def link_gmail? false end end
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/application_operation.rb
Ruby
mit
45
main
202
# frozen_string_literal: true class ApplicationOperation extend Dry::Initializer option :logger, Types::Instance(ATS::Logger), default: -> { ATS::Logger.new(where: self.class.to_s) } end
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/tenants/add.rb
Ruby
mit
45
main
918
# frozen_string_literal: true class Tenants::Add < ApplicationOperation include Dry::Monads[:result, :do] option :company_name, Types::Strict::String def call tenant = Tenant.new(name: company_name) ActiveRecord::Base.transaction do yield save_tenant(tenant) create_mandatory_disqualify_reas...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/scorecard_templates/destroy.rb
Ruby
mit
45
main
825
# frozen_string_literal: true class ScorecardTemplates::Destroy < ApplicationOperation include Dry::Monads[:result] option :scorecard_template, Types.Instance(ScorecardTemplate) option :actor_account, Types::Instance(Account).optional, optional: true def call position_stage = scorecard_template.position_...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/scorecard_templates/change.rb
Ruby
mit
45
main
2,712
# frozen_string_literal: true class ScorecardTemplates::Change < ApplicationOperation include Dry::Monads[:result, :do] option :params, Types::Strict::Hash.schema( title?: Types::String ) option :questions_params, Types::Strict::Array.of( Types::Strict::Hash.schema(question: Types::String) ).optiona...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/scorecard_templates/add.rb
Ruby
mit
45
main
1,767
# frozen_string_literal: true class ScorecardTemplates::Add < ApplicationOperation include Dry::Monads[:result, :do] option :params, Types::Params::Hash.schema( position_stage_id: Types::Params::Integer, title: Types::Params::String ) option :questions_params, Types::Strict::Array.of( Types::Stric...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/scorecard_templates/new.rb
Ruby
mit
45
main
427
# frozen_string_literal: true class ScorecardTemplates::New < ApplicationOperation include Dry::Monads[:result] option :position_stage_id, Types::Params::Integer def call position_stage = PositionStage.find(position_stage_id) params = { position_stage:, title: "#{position_stage.name} stage ...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/note_threads/destroy.rb
Ruby
mit
45
main
522
# frozen_string_literal: true class NoteThreads::Destroy < ApplicationOperation include Dry::Monads[:result, :try] option :note_thread, Types::Instance(NoteThread) def call result = Try[ActiveRecord::RecordInvalid] do note_thread.destroy! if note_thread.notes.blank? end.to_result case result...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/note_threads/add.rb
Ruby
mit
45
main
1,062
# frozen_string_literal: true class NoteThreads::Add < ApplicationOperation include Dry::Monads[:result, :try] option :params, Types::Strict::Hash.schema( candidate_id?: Types::Params::Integer, task_id?: Types::Params::Integer ) option :actor_account, Types::Instance(Account) def call notable_i...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/position_stages/delete.rb
Ruby
mit
45
main
2,561
# frozen_string_literal: true class PositionStages::Delete < ApplicationOperation include Dry::Monads[:result, :do] option :position_stage, Types::Instance(PositionStage) option :actor_account, Types::Instance(Account).optional, optional: true option :stage_to_move_placements_to, Types::Strict::String.optiona...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/position_stages/change.rb
Ruby
mit
45
main
1,189
# frozen_string_literal: true class PositionStages::Change < ApplicationOperation include Dry::Monads[:result, :do] option :params, Types::Strict::Hash.schema( id: Types::Params::Integer, name: Types::Params::String ) option :actor_account, Types::Instance(Account) def call position_stage = Pos...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/position_stages/add.rb
Ruby
mit
45
main
1,034
# frozen_string_literal: true class PositionStages::Add < ApplicationOperation include Dry::Monads[:result, :do] option :params, Types::Strict::Hash.schema( list_index: Types::Params::Integer, name: Types::Params::String, position: Types::Instance(Position) ) option :actor_account, Types::Instance...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/notes/add.rb
Ruby
mit
45
main
5,030
# frozen_string_literal: true class Notes::Add < ApplicationOperation include Dry::Monads[:result, :do] option :text, Types::Strict::String option :note_thread_params, Types::Strict::Hash.schema( id?: Types::Params::Integer, candidate_id?: Types::Params::Integer, task_id?: Types::Params::Integer )...
github
freeats/freeats
https://github.com/freeats/freeats
app/operations/notes/change.rb
Ruby
mit
45
main
2,311
# frozen_string_literal: true class Notes::Change < ApplicationOperation include Dry::Monads[:result, :do] option :id, Types::Strict::String option :text, Types::Strict::String option :actor_account, Types::Instance(Account) option :add_hidden_thread_members, Types::Strict::Bool, default: -> { false } de...