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 | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/other_income_spec.rb | Ruby | mit | 19 | main | 2,253 | require "rails_helper"
RSpec.describe CFECivil::Components::OtherIncome do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there is no other_income" do
it "returns the expected, empty, JSON block" d... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/assessment_spec.rb | Ruby | mit | 19 | main | 668 | require "rails_helper"
RSpec.describe CFECivil::Components::Assessment do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_positive_benefit_check_result, application_ref: "L-T5T-R3F", transaction_period_finish_on: target_time) }
le... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/outgoings_spec.rb | Ruby | mit | 19 | main | 3,757 | require "rails_helper"
RSpec.describe CFECivil::Components::Outgoings do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there are no outgoings" do
it "returns the expected, empty, JSON block" do
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/irregular_incomes_spec.rb | Ruby | mit | 19 | main | 1,712 | require "rails_helper"
RSpec.describe CFECivil::Components::IrregularIncomes do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, applicant:, partner:) }
context "when there are no irregular payments" do
let(:applicant) { create(:app... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/capitals_spec.rb | Ruby | mit | 19 | main | 3,836 | require "rails_helper"
RSpec.describe CFECivil::Components::Capitals do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant, with_bank_accounts: 6) }
let(:submission) { create(:cfe_submission, aasm_state: "applicant_created"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/vehicles_spec.rb | Ruby | mit | 19 | main | 1,846 | require "rails_helper"
RSpec.describe CFECivil::Components::Vehicles do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant_and_partner) }
context "when there are no vehicles" do
it "returns the expected JSON block" do
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/applicant_spec.rb | Ruby | mit | 19 | main | 864 | require "rails_helper"
RSpec.describe CFECivil::Components::Applicant do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_positive_benefit_check_result, transaction_period_finish_on: Time.zone.today) }
before do
create(:applic... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/regular_transactions_spec.rb | Ruby | mit | 19 | main | 2,475 | require "rails_helper"
RSpec.describe CFECivil::Components::RegularTransactions do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant_and_partner) }
context "when there are no regular transactions" do
it "returns the e... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/employments_spec.rb | Ruby | mit | 19 | main | 4,806 | require "rails_helper"
RSpec.describe CFECivil::Components::Employments do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application) }
context "when the applicant is not employed" do
before { create(:applicant, :not_employed, legal_aid_appli... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/properties_spec.rb | Ruby | mit | 19 | main | 1,686 | require "rails_helper"
RSpec.describe CFECivil::Components::Properties do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there are no properties" do
it "returns the expected JSON block" do
ex... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/dependants_spec.rb | Ruby | mit | 19 | main | 1,136 | require "rails_helper"
RSpec.describe CFECivil::Components::Dependants do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there are no dependants" do
it "returns expected JSON structure" do
ex... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/state_benefits_spec.rb | Ruby | mit | 19 | main | 1,861 | require "rails_helper"
RSpec.describe CFECivil::Components::StateBenefits do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there are no state_benefits" do
it "returns the expected, empty, JSON blo... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/cfe_civil/components/explicit_remarks_spec.rb | Ruby | mit | 19 | main | 830 | require "rails_helper"
RSpec.describe CFECivil::Components::ExplicitRemarks do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) { create(:legal_aid_application, :with_applicant) }
context "when there are no remarks to send" do
it "renders the expected, empty, JSON"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/make_link_spec.rb | Ruby | mit | 19 | main | 1,042 | require "rails_helper"
RSpec.describe TaskStatus::MakeLink do
subject(:instance) { described_class.new(application, status_results) }
let(:application) { create(:application) }
let(:status_results) { {} }
describe "#call" do
subject(:status) { instance.call }
context "with an incomplete applicant" d... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/partner_spec.rb | Ruby | mit | 19 | main | 2,721 | require "rails_helper"
RSpec.describe TaskStatus::Partner do
subject(:instance) { described_class.new(application, status_results) }
let(:application) { create(:application, :with_applicant, :with_multiple_proceedings_inc_section8) }
let(:status_results) { {} }
let(:overriding_dwp_result) { false }
let(:non... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/applicants_spec.rb | Ruby | mit | 19 | main | 1,201 | require "rails_helper"
RSpec.describe TaskStatus::Applicants do
subject(:instance) { described_class.new(application, status_results: {}) }
let(:application) { create(:application, applicant:) }
let(:complete_applicant) do
create(
:applicant,
has_national_insurance_number: true,
national_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/base_spec.rb | Ruby | mit | 19 | main | 2,290 | require "rails_helper"
RSpec.describe TaskStatus::Base do
subject(:instance) { sub_class.new(application, status_results) }
let(:sub_class) do
Class.new(described_class) do
private
def perform(status)
status.not_started!
end
end
end
let(:application) { create(:application) }
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/dwp_outcome_spec.rb | Ruby | mit | 19 | main | 1,628 | require "rails_helper"
RSpec.describe TaskStatus::DWPOutcome do
describe "#call", :vcr do
subject(:task_status) { described_class.new(application, status_results).call }
let(:application) { create(:application, linked_application_completed: true, dwp_result_confirmed:, dwp_override:) }
let(:dwp_override... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/value_object_spec.rb | Ruby | mit | 19 | main | 3,000 | require "rails_helper"
RSpec.describe TaskStatus::ValueObject do
subject(:object) { described_class.new }
it "defines getter and setter methods for each status" do
expect(object)
.to respond_to(
:not_needed!,
:not_needed?,
:cannot_start!,
:cannot_start?,
:not_read... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/proceedings_types_spec.rb | Ruby | mit | 19 | main | 1,804 | require "rails_helper"
RSpec.describe TaskStatus::ProceedingsTypes do
subject(:instance) { described_class.new(application, status_results) }
let(:application) { create(:application, applicant:) }
let(:status_results) { {} }
let(:applicant) do
create(
:applicant,
has_national_insurance_number... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/check_provider_answers_spec.rb | Ruby | mit | 19 | main | 2,263 | require "rails_helper"
RSpec.describe TaskStatus::CheckProviderAnswers do
subject(:instance) { described_class.new(application, status_results) }
let(:application) { create(:application, :with_complete_applicant_and_proceedings, linked_application_completed: true) }
let(:status_results) { {} }
describe "#cal... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/validators/applicants_spec.rb | Ruby | mit | 19 | main | 4,433 | require "rails_helper"
require_relative "task_status_validator_shared_examples"
RSpec.describe TaskStatus::Validators::Applicants do
subject(:validator) { described_class.new(application) }
let(:application) { create(:application) }
let(:complete_applicant) do
create(
:applicant,
has_national_i... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/validators/proceedings_types_spec.rb | Ruby | mit | 19 | main | 20,180 | require "rails_helper"
require_relative "task_status_validator_shared_examples"
RSpec.describe TaskStatus::Validators::ProceedingsTypes, :vcr do
subject(:validator) { described_class.new(application) }
let(:application) do
create(:application, emergency_cost_override:,
emergency_cost_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/task_status/validators/partner_spec.rb | Ruby | mit | 19 | main | 1,738 | require "rails_helper"
require_relative "task_status_validator_shared_examples"
RSpec.describe TaskStatus::Validators::Partner do
subject(:validator) { described_class.new(legal_aid_application) }
it_behaves_like "a task status validator" do
let(:legal_aid_application) { create(:application) }
end
descri... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/slack/send_message_spec.rb | Ruby | mit | 19 | main | 1,123 | require "rails_helper"
RSpec.describe Slack::SendMessage do
subject(:slack_send_message) { described_class }
before do
allow(ENV).to receive(:fetch)
allow(ENV).to receive(:fetch).with("SLACK_ALERT_WEBHOOK", nil).and_return(webhook_url)
stub_request(:post, webhook_url).to_return(body: "OK", status: 200... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/query/incomplete_proceedings_spec.rb | Ruby | mit | 19 | main | 4,847 | require "rails_helper"
module Query
RSpec.describe IncompleteProceedings do
subject(:query) { described_class.call(proceeding.legal_aid_application) }
context "when a proceeding has all values present" do
let(:proceeding) do
create(:proceeding, :da001, :with_df_date,
accepted_em... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/reports_types_creator_spec.rb | Ruby | mit | 19 | main | 6,687 | require "rails_helper"
RSpec.describe Reports::ReportsTypesCreator do
let(:firm) { create(:firm) }
let(:provider) { create(:provider, firm:) }
let!(:application_non_passported) do
create(:legal_aid_application,
:with_everything,
:at_assessment_submitted,
:with_negative_benefi... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/merits_report_creator_spec.rb | Ruby | mit | 19 | main | 4,671 | require "rails_helper"
RSpec.describe Reports::MeritsReportCreator do
subject(:call) do
# don't match on path - webpacker keeps changing the second part of the path
VCR.use_cassette("stylesheets2", match_requests_on: %i[method host headers]) do
instance.call
end
end
let(:legal_aid_application)... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/reports_creator_spec.rb | Ruby | mit | 19 | main | 1,776 | require "rails_helper"
RSpec.describe Reports::ReportsCreator do
subject(:call) { described_class.call(legal_aid_application) }
let(:legal_aid_application) do
create(:legal_aid_application,
:with_proceedings,
:with_ccms_submission,
:with_everything,
:with_passported... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/means_report_creator_spec.rb | Ruby | mit | 19 | main | 5,019 | require "rails_helper"
RSpec.describe Reports::MeansReportCreator do
describe ".call" do
subject(:call) do
# dont' match on path - webpacker keeps changing the second part of the path
VCR.use_cassette("stylesheets2", match_requests_on: %i[method host headers]) do
described_class.call(legal_ai... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/mis/application_detail_csv_line_spec.rb | Ruby | mit | 19 | main | 46,593 | require "rails_helper"
module Reports
module MIS
RSpec.describe ApplicationDetailCsvLine do
let(:legal_aid_application) do
create(:application,
:with_proceedings,
:with_delegated_functions_on_proceedings,
explicit_proceedings: [:da004],
se... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/mis/sanitisable_spec.rb | Ruby | mit | 19 | main | 597 | require "rails_helper"
module Reports
module MIS
class TestCsvLine
include Sanitisable
def initialize
@line = ["+field_1", "-field_2", "=field_3", "@field_4", "%field_5"]
end
end
RSpec.describe Sanitisable do
describe "sanitise" do
let(:test_line) { TestCsvLine.n... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/mis/non_passported_applications_report_spec.rb | Ruby | mit | 19 | main | 3,385 | require "rails_helper"
module Reports
module MIS
RSpec.describe NonPassportedApplicationsReport do
subject { described_class.new.run }
before do
create_early_non_passported_application
travel_to(8.minutes.ago) { create_non_passported_application }
travel_to(6.minutes.ago) { c... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/mis/application_details_report_spec.rb | Ruby | mit | 19 | main | 3,019 | require "rails_helper"
module Reports
module MIS
RSpec.describe ApplicationDetailsReport do
let!(:unsubmitted_applications) do
create_list(:legal_aid_application, 3,
:with_proceedings,
:with_applicant,
:with_parties_mental_capacity,
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/mis/non_passported_application_csv_line_spec.rb | Ruby | mit | 19 | main | 2,704 | require "rails_helper"
module Reports
module MIS
DATE_TIME_REGEX = /^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/
RSpec.describe NonPassportedApplicationCsvLine do
describe ".header_row" do
let(:expected_header_row) do
%w[
state
ccms_reason
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/reports/bank_transactions/bank_transaction_report_creator_spec.rb | Ruby | mit | 19 | main | 3,004 | require "rails_helper"
module Reports
module BankTransactions
RSpec.describe BankTransactionReportCreator do
let(:legal_aid_application) do
create(:legal_aid_application,
:with_proceedings,
:with_everything,
:with_benefits_transactions,
:w... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/banking/bank_transactions_trimmer_spec.rb | Ruby | mit | 19 | main | 2,883 | require "rails_helper"
RSpec.describe Banking::BankTransactionsTrimmer do
describe ".call" do
subject(:bank_transaction_trimmer) { described_class.call(application) }
let(:application) { create(:legal_aid_application, :with_applicant) }
let(:applicant) { application.applicant }
let(:bank) { create(:... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/banking/bank_transaction_balance_calculator_spec.rb | Ruby | mit | 19 | main | 2,381 | require "rails_helper"
module Banking
RSpec.describe BankTransactionBalanceCalculator do
subject(:bank_transaction_balance_calculator) { described_class.call(application) }
let(:application) { create(:legal_aid_application, :with_applicant) }
let(:applicant) { application.applicant }
let(:bank) { cr... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/metrics/sidekiq_queue_sizes_spec.rb | Ruby | mit | 19 | main | 1,343 | require "rails_helper"
RSpec.describe Metrics::SidekiqQueueSizes do
describe "#call" do
subject(:call_queue_sizes) { described_class.call(prometheus_client) }
let(:queues) { %w[default mailers active_storage_analysis active_storage_purge] }
let(:prometheus_client) { instance_spy(PrometheusExporter::Clie... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/metrics/send_metrics_spec.rb | Ruby | mit | 19 | main | 1,483 | require "rails_helper"
RSpec.describe Metrics::SendMetrics do
describe "#call" do
subject(:call_send_metrics) { described_class.call }
let(:metrics_service_host) { Faker::Internet.domain_word }
let(:prometheus_client) { instance_spy(PrometheusExporter::Client) }
let(:prometheus_thread_sleep) { rand(... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/services/populators/transaction_type_populator_spec.rb | Ruby | mit | 19 | main | 3,355 | require "rails_helper"
module Populators
RSpec.describe TransactionTypePopulator do
describe ".call" do
subject(:call) { described_class.call }
let(:names) { TransactionType::NAMES }
let(:credit_names) { names[:credit] }
let(:debit_names) { names[:debit] }
let(:total) { credit_name... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/pdf_converter_worker_spec.rb | Ruby | mit | 19 | main | 2,935 | require "rails_helper"
RSpec.describe PDFConverterWorker, type: :worker do
subject(:perform) { instance.perform(uuid) }
let(:instance) { described_class.new }
let(:uuid) { SecureRandom.uuid }
describe "#perform" do
context "when conversion successful" do
it "calls PDFAttachmentCreator" do
e... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/true_layer_banks_update_worker_spec.rb | Ruby | mit | 19 | main | 1,819 | require "rails_helper"
RSpec.describe TrueLayerBanksUpdateWorker, vcr: { cassette_name: "true_layer_banks_api", allow_playback_repeats: true } do
subject(:update_worker) { true_layer_banks_update_worker.perform }
let(:true_layer_banks_update_worker) { described_class.new }
let(:stale_date) { Time.current.utc - ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/import_bank_data_worker_spec.rb | Ruby | mit | 19 | main | 1,413 | require "rails_helper"
require "sidekiq/testing"
RSpec.describe ImportBankDataWorker, type: :worker do
subject(:perform_job) { described_class.perform_async(legal_aid_application.id) }
let(:legal_aid_application) { create(:legal_aid_application, applicant:) }
let(:applicant) { build(:applicant, :with_encrypted_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/bank_holiday_update_worker_spec.rb | Ruby | mit | 19 | main | 2,319 | require "rails_helper"
RSpec.describe BankHolidayUpdateWorker, vcr: { cassette_name: "gov_uk_bank_holiday_api", allow_playback_repeats: true } do
subject(:update_worker) { bank_holiday_update_worker.perform }
let(:bank_holiday_update_worker) { described_class.new }
let(:stale_date) { Time.current.utc - 1.month ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/provider_contract_details_worker_spec.rb | Ruby | mit | 19 | main | 334 | require "rails_helper"
require "sidekiq/testing"
RSpec.describe ProviderContractDetailsWorker do
subject(:perform) { described_class.new.perform(office_code) }
let(:office_code) { "A1345X1" }
it "calls PDA::CurrentContracts" do
expect(PDA::CurrentContracts).to receive(:call).with(office_code).once
perf... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/ccms/restart_submission_worker_spec.rb | Ruby | mit | 19 | main | 602 | require "rails_helper"
RSpec.describe CCMS::RestartSubmissionWorker do
describe "#perform" do
subject(:perform) { described_class.new.perform(legal_aid_application.id) }
let(:legal_aid_application) { instance_double(LegalAidApplication, id: "TEST-1234", restart_submission!: "triggered") }
before { allo... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/ccms/submission_process_worker_spec.rb | Ruby | mit | 19 | main | 4,915 | require "rails_helper"
RSpec.describe CCMS::SubmissionProcessWorker do
let(:state) { :initialised }
let(:submission) { create(:submission, aasm_state: state) }
let(:worker) { described_class.new }
before do
allow(CCMS::Submission).to receive(:find).with(submission.id).and_return(submission)
allow(subm... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/ccms/turn_on_submissions_worker_spec.rb | Ruby | mit | 19 | main | 1,463 | require "rails_helper"
RSpec.describe CCMS::TurnOnSubmissionsWorker do
describe ".perform" do
subject(:perform) { described_class.new.perform }
before do
allow(Rails.logger).to receive(:info)
allow(CCMS::RestartSubmissionWorker).to receive(:perform_in).and_return("started")
end
context ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/hmrc/result_worker_spec.rb | Ruby | mit | 19 | main | 5,879 | require "rails_helper"
RSpec.describe HMRC::ResultWorker do
subject(:worker) { described_class.new }
let(:application) { create(:legal_aid_application, :with_applicant, :with_transaction_period) }
let(:applicant) { application.applicant }
let(:hmrc_response) do
create(:hmrc_response, :use_case_one, :in_pr... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/workers/hmrc/submission_worker_spec.rb | Ruby | mit | 19 | main | 4,062 | require "rails_helper"
RSpec.describe HMRC::SubmissionWorker do
subject(:worker) { described_class.new }
let(:application) { create(:legal_aid_application, :with_applicant, :with_transaction_period) }
let(:applicant) { application.applicant }
let(:hmrc_response) { create(:hmrc_response, :use_case_two, legal_a... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/base_form_spec.rb | Ruby | mit | 19 | main | 875 | require "rails_helper"
RSpec.describe BaseForm do
describe "#exclude_from_model" do
context "when the derived form does not define #exclude_from_model" do
it "returns an empty array" do
form = Addresses::AddressLookupForm.new
expect(form.exclude_from_model).to eq []
end
end
end
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/home_address/status_form_spec.rb | Ruby | mit | 19 | main | 2,254 | require "rails_helper"
RSpec.describe HomeAddress::StatusForm, type: :form do
subject(:instance) { described_class.new(params) }
let(:applicant) { create(:applicant) }
let(:params) do
{
model: applicant,
no_fixed_residence:,
}
end
describe "#save" do
subject(:call_save) { instance.s... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/office_form_spec.rb | Ruby | mit | 19 | main | 632 | require "rails_helper"
RSpec.describe Providers::OfficeForm do
subject(:office_form) { described_class.new(params) }
let(:provider) { create :provider, office_codes: "0X395U:2N078D:A123456" }
let(:params) { { selected_office_code:, model: provider } }
context "when the select_office_id param in included in t... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/regular_transaction_form_spec.rb | Ruby | mit | 19 | main | 5,971 | require "rails_helper"
RSpec.describe Providers::RegularTransactionForm do
describe "#transaction_type_conditions" do
context "when the method is not implemented" do
let(:conditions_not_implemented_form) do
Class.new(described_class) do
private
def owner
"fake object"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/other_assets_form_spec.rb | Ruby | mit | 19 | main | 7,703 | require "rails_helper"
RSpec.describe Providers::OtherAssetsForm do
let(:empty_oad) { create(:other_assets_declaration, none_selected: true) }
let(:oad_with_second_home) { create(:other_assets_declaration, :with_second_home) }
let(:oad_with_all_values) { create(:other_assets_declaration, :with_all_values) }
c... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/dwp/shared_examples_for_override_form.rb | Ruby | mit | 19 | main | 779 | RSpec.shared_examples "an overrides_form" do
describe "validation" do
context "when the dwp result is correct" do
let(:params) { { confirm_dwp_result: "no_benefit_received" } }
it { is_expected.to be_valid }
end
context "when the applicant receives a passporting benefit that is not joint" do... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/dwp/partner_overrides_form_spec.rb | Ruby | mit | 19 | main | 639 | require "rails_helper"
require_relative "shared_examples_for_override_form"
RSpec.describe Providers::DWP::PartnerOverridesForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { confirm_dwp_result: nil } }
describe "validation" do
it_behaves_like "an overrides_form"
conte... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/dwp/fallback_form_spec.rb | Ruby | mit | 19 | main | 1,022 | require "rails_helper"
require_relative "shared_examples_for_override_form"
RSpec.describe Providers::DWP::FallbackForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { confirm_dwp_result: nil } }
describe "validation" do
it_behaves_like "an overrides_form"
context "when... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/partners/regular_outgoings_form_spec.rb | Ruby | mit | 19 | main | 20,978 | require "rails_helper"
# rubocop:disable Rails/SaveBang
RSpec.describe Providers::Partners::RegularOutgoingsForm do
describe "#validate" do
let(:legal_aid_application) { build_stubbed(:legal_aid_application, :with_applicant_and_partner) }
context "when neither an outgoing type or none are selected" do
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/partners/regular_income_form_spec.rb | Ruby | mit | 19 | main | 5,147 | require "rails_helper"
RSpec.describe Providers::Partners::RegularIncomeForm do
describe "#validate" do
let(:legal_aid_application) { build_stubbed(:legal_aid_application, :with_applicant_and_partner) }
context "when neither an outgoing type or none are selected" do
it "is invalid" do
params =... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/first_appeal_court_type_form_spec.rb | Ruby | mit | 19 | main | 698 | require "rails_helper"
require_relative "shared_examples_for_appeal_court_type_forms"
RSpec.describe Providers::ApplicationMeritsTask::FirstAppealCourtTypeForm do
let(:appeal) { create(:appeal, second_appeal: false, court_type: nil) }
let(:params) do
{
model: appeal,
court_type:,
}
end
it... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/child_subject_form_spec.rb | Ruby | mit | 19 | main | 1,241 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::ChildSubjectForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { relationship_to_children: } }
describe "#save" do
context "with validation" do
before { form.valid? }
context "when sent text... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/statement_of_case_choice_form_spec.rb | Ruby | mit | 19 | main | 1,864 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::StatementOfCaseChoiceForm do
let(:statement_of_case) { build(:statement_of_case, statement:, typed:, upload:) }
let(:params) do
{
model: statement_of_case,
statement:,
typed:,
upload:,
}
end
let(:statement... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/second_appeal_court_type_form_spec.rb | Ruby | mit | 19 | main | 926 | require "rails_helper"
require_relative "shared_examples_for_appeal_court_type_forms"
RSpec.describe Providers::ApplicationMeritsTask::SecondAppealCourtTypeForm do
let(:appeal) { create(:appeal, second_appeal: true, court_type: nil) }
let(:params) do
{
model: appeal,
court_type:,
}
end
it... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/biological_parent_form_spec.rb | Ruby | mit | 19 | main | 2,078 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::BiologicalParentForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { relationship_to_children: } }
describe "#save" do
context "with validation" do
before { form.valid? }
context "when sent ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/original_judge_level_form_spec.rb | Ruby | mit | 19 | main | 3,567 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::OriginalJudgeLevelForm do
let(:appeal) { create(:appeal, original_judge_level: nil) }
let(:params) do
{
model: appeal,
original_judge_level:,
}
end
describe "#validate" do
subject(:form) { described_class.new(para... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/parental_responsibilities_form_spec.rb | Ruby | mit | 19 | main | 2,550 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::ParentalResponsibilitiesForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { relationship_to_children: } }
describe "#save" do
context "with validation" do
before { form.valid? }
context "wh... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/nature_of_urgency_form_spec.rb | Ruby | mit | 19 | main | 4,029 | require "rails_helper"
module Providers
module ApplicationMeritsTask
RSpec.describe NatureOfUrgencyForm do
subject(:form) { described_class.new(params) }
let(:urgency) { create(:urgency) }
let(:params) do
{
nature_of_urgency:,
hearing_date_set:,
hearing_da... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/second_appeal_form_spec.rb | Ruby | mit | 19 | main | 3,573 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::SecondAppealForm do
let(:appeal) { create(:appeal, second_appeal: nil) }
let(:params) do
{
model: appeal,
second_appeal:,
}
end
describe "#validate" do
subject(:form) { described_class.new(params) }
context "... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/involved_child_form_spec.rb | Ruby | mit | 19 | main | 3,378 | require "rails_helper"
module Providers
module ApplicationMeritsTask
RSpec.describe InvolvedChildForm do
subject(:described_form) { described_class.new(params) }
let(:earliest_date) { Date.new(2000, 1, 1) }
let(:dob) { Faker::Date.between(from: earliest_date, to: Date.current) }
let(:fir... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/shared_examples_for_appeal_court_type_forms.rb | Ruby | mit | 19 | main | 3,055 | RSpec.shared_examples "appeal court type selector form" do
let(:params) do
{
model: appeal,
court_type:,
}
end
describe "#validate" do
subject(:form) { described_class.new(params) }
context "when court_type is supreme_court" do
let(:court_type) { "supreme_court" }
it "is... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/plf_court_order_form_spec.rb | Ruby | mit | 19 | main | 2,938 | require "rails_helper"
module Providers::ApplicationMeritsTask
RSpec.describe PLFCourtOrderForm do
let(:legal_aid_application) { create :legal_aid_application }
let(:params) do
{
model: legal_aid_application,
plf_court_order:,
}
end
describe "#validate" do
subject(:... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/matter_opposed_reason_form_spec.rb | Ruby | mit | 19 | main | 1,401 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::MatterOpposedReasonForm do
let(:legal_aid_application) { create(:legal_aid_application) }
let(:params) { { reason:, legal_aid_application_id: legal_aid_application.id } }
describe "#validate" do
subject(:form) { described_class.new(para... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/statement_of_case_upload_form_spec.rb | Ruby | mit | 19 | main | 1,254 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::StatementOfCaseUploadForm do
let(:statement_of_case) { build(:statement_of_case, statement:, typed:, upload:) }
let(:params) do
{
model: statement_of_case,
original_file:,
}
end
let(:statement) { nil }
let(:typed) {... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/client_denial_of_allegation_form_spec.rb | Ruby | mit | 19 | main | 1,151 | require "rails_helper"
module Providers
module ApplicationMeritsTask
RSpec.describe ClientDenialOfAllegationForm do
subject(:denial_form) { described_class.new(params) }
let(:params) do
{
denies_all:,
additional_information:,
}
end
let(:denies_all) { t... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/matter_opposed_form_spec.rb | Ruby | mit | 19 | main | 1,920 | require "rails_helper"
RSpec.describe Providers::ApplicationMeritsTask::MatterOpposedForm do
let(:legal_aid_application) { create(:legal_aid_application) }
let(:params) { { model: build(:matter_opposition, legal_aid_application:), matter_opposed: } }
describe "#validate" do
subject(:form) { described_class.... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/application_merits_task/client_offered_undertakings_form_spec.rb | Ruby | mit | 19 | main | 2,338 | require "rails_helper"
module Providers
module ApplicationMeritsTask
RSpec.describe ClientOfferedUndertakingsForm do
subject(:undertaking_form) { described_class.new(form_params) }
let(:params) do
{
offered:,
additional_information_true:,
additional_information_... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/state_benefit_form_spec.rb | Ruby | mit | 19 | main | 4,048 | require "rails_helper"
RSpec.describe Providers::Means::StateBenefitForm do
subject(:state_benefit_form) { described_class.new(params) }
let(:legal_aid_application) { create(:legal_aid_application) }
let(:transaction_type) { create(:transaction_type, :benefits) }
let(:params) do
{
description:,
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/regular_income_form_spec.rb | Ruby | mit | 19 | main | 21,982 | require "rails_helper"
# rubocop:disable Rails/SaveBang
RSpec.describe Providers::Means::RegularIncomeForm do
describe "#validate" do
let(:legal_aid_application) { build_stubbed(:legal_aid_application, :with_applicant) }
context "when neither a income type or none are selected" do
it "is invalid" do
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/regular_outgoings_form_spec.rb | Ruby | mit | 19 | main | 21,408 | require "rails_helper"
# rubocop:disable Rails/SaveBang
RSpec.describe Providers::Means::RegularOutgoingsForm do
describe "#validate" do
let(:legal_aid_application) { build_stubbed(:legal_aid_application, :with_applicant) }
context "when neither a outgoing type or none are selected" do
it "is invalid"... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/housing_benefit_form_spec.rb | Ruby | mit | 19 | main | 18,146 | require "rails_helper"
# rubocop:disable Rails/SaveBang
RSpec.describe Providers::Means::HousingBenefitForm do
describe "#new" do
context "when the applicant is receiving housing benefit" do
it "assigns housing benefit attributes" do
legal_aid_application = create(
:legal_aid_application,... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/capital_disregards/add_details_form_spec.rb | Ruby | mit | 19 | main | 7,322 | require "rails_helper"
RSpec.describe Providers::Means::CapitalDisregards::AddDetailsForm do
subject(:form) { described_class.new(params.merge(model: capital_disregard)) }
let(:application) { create(:legal_aid_application, :with_applicant, capital_disregards: [capital_disregard]) }
let(:capital_disregard) { cre... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/capital_disregards/mandatory_form_spec.rb | Ruby | mit | 19 | main | 4,168 | require "rails_helper"
RSpec.describe Providers::Means::CapitalDisregards::MandatoryForm do
subject(:form) { described_class.new(mandatory_capital_disregards_params.merge(model: application)) }
let(:application) { create(:legal_aid_application) }
let(:none_selected) { "" }
let(:mandatory_capital_disregards) ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/means/capital_disregards/discretionary_form_spec.rb | Ruby | mit | 19 | main | 6,272 | require "rails_helper"
RSpec.describe Providers::Means::CapitalDisregards::DiscretionaryForm do
subject(:form) { described_class.new(discretionary_capital_disregards_params.merge(model: application)) }
let(:application) { create(:legal_aid_application) }
let(:none_selected) { "" }
let(:discretionary_capital_d... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_interrupts/related_orders_form_spec.rb | Ruby | mit | 19 | main | 2,757 | require "rails_helper"
RSpec.describe Providers::ProceedingInterrupts::RelatedOrdersForm do
subject(:form) { described_class.new(form_params) }
let(:proceeding) { create(:proceeding, :pbm05) }
let(:form_params) { params.merge(model: proceeding) }
let(:params) do
{
related_orders:,
none_selecte... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/vary_order_form_spec.rb | Ruby | mit | 19 | main | 594 | require "rails_helper"
RSpec.describe Providers::ProceedingMeritsTask::VaryOrderForm do
subject(:form) { described_class.new(params) }
let(:params) { { details: } }
let(:details) { "Some input details" }
it { is_expected.to respond_to(:details, :proceeding_id) }
describe "#valid?" do
context "when det... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/child_care_assessment_form_spec.rb | Ruby | mit | 19 | main | 5,819 | require "rails_helper"
module Providers
module ProceedingMeritsTask
RSpec.describe ChildCareAssessmentForm do
subject(:form) { described_class.new(params) }
let(:child_care_assessment) { create(:child_care_assessment, assessed: nil, proceeding:) }
let(:proceeding) { create(:proceeding, :pbm32)... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/specific_issue_form_spec.rb | Ruby | mit | 19 | main | 764 | require "rails_helper"
RSpec.describe Providers::ProceedingMeritsTask::SpecificIssueForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) do
{
details:,
}
end
describe "#save" do
context "with validation" do
before { form.valid? }
context "when the pa... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/chances_of_success_form_spec.rb | Ruby | mit | 19 | main | 4,798 | require "rails_helper"
module Providers
module ProceedingMeritsTask
RSpec.describe ChancesOfSuccessForm do
subject(:form) { described_class.new(params) }
let(:chances_of_success) { create(:chances_of_success, proceeding:) }
let(:proceeding) { create(:proceeding, :pbm32) }
let(:params) d... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/linked_children_form_spec.rb | Ruby | mit | 19 | main | 4,390 | require "rails_helper"
RSpec.describe Providers::ProceedingMeritsTask::LinkedChildrenForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { linked_children: linked_children_params, model: proceeding } }
let(:legal_aid_application) { create(:legal_aid_application, :with_involved_chi... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/prohibited_steps_form_spec.rb | Ruby | mit | 19 | main | 1,264 | require "rails_helper"
module Providers
module ProceedingMeritsTask
RSpec.describe ProhibitedStepsForm do
subject(:prohibited_steps_form) { described_class.new(params) }
let(:params) do
{
uk_removal:,
details:,
}
end
let(:uk_removal) { "true" }
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/attempts_to_settle_form_spec.rb | Ruby | mit | 19 | main | 773 | require "rails_helper"
RSpec.describe Providers::ProceedingMeritsTask::AttemptsToSettleForm, type: :form do
subject(:form) { described_class.new(params) }
let(:params) { { attempts_made: } }
describe "#save" do
context "with validation" do
before { form.valid? }
context "when the parameters ar... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/opponents_application_form_spec.rb | Ruby | mit | 19 | main | 1,306 | require "rails_helper"
module Providers
module ProceedingMeritsTask
RSpec.describe OpponentsApplicationForm do
subject(:opponents_application_form) { described_class.new(params) }
let(:params) do
{
has_opponents_application:,
reason_for_applying:,
}
end
... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/proceeding_merits_task/child_care_assessment_result_form_spec.rb | Ruby | mit | 19 | main | 6,941 | require "rails_helper"
module Providers
module ProceedingMeritsTask
RSpec.describe ChildCareAssessmentResultForm do
subject(:form) { described_class.new(params) }
let(:child_care_assessment) { create(:child_care_assessment, assessed: nil, proceeding:) }
let(:proceeding) { create(:proceeding, :... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/link_application/make_link_form_spec.rb | Ruby | mit | 19 | main | 5,317 | require "rails_helper"
RSpec.describe Providers::LinkApplication::MakeLinkForm, type: :form do
subject(:instance) { described_class.new(params) }
let(:params) do
{
link_type_code:,
model: linked_application,
}
end
let(:legal_aid_application) { create(:legal_aid_application) }
let(:linked... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/link_application/find_link_application_form_spec.rb | Ruby | mit | 19 | main | 6,366 | require "rails_helper"
RSpec.describe Providers::LinkApplication::FindLinkApplicationForm, type: :form do
subject(:instance) { described_class.new(params) }
let(:params) do
{
search_laa_reference:,
model: linked_application,
}
end
let(:legal_aid_application) { create(:legal_aid_application... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/link_application/confirm_link_form_spec.rb | Ruby | mit | 19 | main | 3,542 | require "rails_helper"
RSpec.describe Providers::LinkApplication::ConfirmLinkForm, type: :form do
subject(:instance) { described_class.new(params) }
let(:linked_application) { LinkedApplication.create!(lead_application_id: lead_application.id, associated_application_id: legal_aid_application.id, link_type_code:) ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/providers/link_application/copy_form_spec.rb | Ruby | mit | 19 | main | 3,005 | require "rails_helper"
RSpec.describe Providers::LinkApplication::CopyForm, type: :form do
subject(:described_form) { described_class.new(params.merge(model: application)) }
let(:lead_application) { create(:legal_aid_application) }
let(:application) { create(:legal_aid_application, :with_applicant_and_address, ... |
github | ministryofjustice/laa-apply-for-legal-aid | https://github.com/ministryofjustice/laa-apply-for-legal-aid | spec/forms/opponents/mental_capacity_form_spec.rb | Ruby | mit | 19 | main | 1,306 | require "rails_helper"
RSpec.describe Opponents::MentalCapacityForm, type: :form do
subject(:mental_capacity_form) { described_class.new(form_params) }
let(:params) do
{
"understands_terms_of_court_order" => "false",
"understands_terms_of_court_order_details" => "New understands terms of court ord... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.