From 17da9ef037cd3062771c711f4f4df562f27f90c4 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 21:44:42 -0600 Subject: [PATCH 01/12] Added: Automatic spec testing w/ github actions --- .github/workflows/ci.yml | 45 +++++++++++++++++++ .../config/database.yml.github-actions | 8 ++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 job_tracker/config/database.yml.github-actions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0065ad4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +on: [pull_request] +jobs: + build: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11 + ports: + - 5432:5432 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - uses: actions/checkout@v1 + + - uses: actions/setup-ruby@v1 + with: + ruby-version: 2.5.5 + + - name: Install dependent libraries + run: sudo apt-get install libpq-dev + + - name: Bundle install + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Setup Database + run: | + cp config/database.yml.github-actions config/database.yml + bundle exec rake db:create + bundle exec rake db:schema:load + env: + RAILS_ENV: test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + + - name: Run RSpec + run: COVERAGE=true bundle exec rspec --require rails_helper + env: + RAILS_ENV: test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres \ No newline at end of file diff --git a/job_tracker/config/database.yml.github-actions b/job_tracker/config/database.yml.github-actions new file mode 100644 index 0000000..0724691 --- /dev/null +++ b/job_tracker/config/database.yml.github-actions @@ -0,0 +1,8 @@ +test: + adapter: postgresql + host: localhost + encoding: unicode + database: github-actions + pool: 20 + username: <%= ENV["POSTGRES_USER"] %> + password: <%= ENV["POSTGRES_PASSWORD"] %> From 17c2944fe5f263d244baec6e52c0ee28079d0d73 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 21:48:34 -0600 Subject: [PATCH 02/12] Update: ruby & postgres version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0065ad4..d5051a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:11 + image: postgres:14.10 ports: - 5432:5432 env: @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-ruby@v1 with: - ruby-version: 2.5.5 + ruby-version: 3.3.0 - name: Install dependent libraries run: sudo apt-get install libpq-dev From e6f87e76802d6853902c6ec076f1b4f456e235bf Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 21:54:07 -0600 Subject: [PATCH 03/12] Fix attempt: Switch to most recent ruby/setup --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5051a9..09513c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,13 @@ jobs: POSTGRES_PASSWORD: postgres options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3.0 + ruby-version: '3.3' + bundler-cache: true + - run: bundle exec rake - name: Install dependent libraries run: sudo apt-get install libpq-dev From dd38744821c96eb49a8259cad70efb06e1567440 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 21:55:49 -0600 Subject: [PATCH 04/12] Fix: Attempt 2 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09513c4..b099960 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: with: ruby-version: '3.3' bundler-cache: true - - run: bundle exec rake - name: Install dependent libraries run: sudo apt-get install libpq-dev From 6fe35a276ee2885f8b93987c13fee5951d577c89 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:03:07 -0600 Subject: [PATCH 05/12] Fix: Attempt 3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b099960..51bf3a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Bundle install run: | gem install bundler - bundle install --jobs 4 --retry 3 + bundle exec rake - name: Setup Database run: | From bcece9cbcb795fc166dc7b0efab30a398e848d28 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:07:51 -0600 Subject: [PATCH 06/12] Fix: Attempt 4 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51bf3a8..0d61b8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: - name: Bundle install run: | gem install bundler + cd job_tracker bundle exec rake - name: Setup Database From 67072e017c6a6f45d59af5942a52c673d0c36b7b Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:09:37 -0600 Subject: [PATCH 07/12] Fix: Attempt 5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d61b8f..9f85591 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: run: | gem install bundler cd job_tracker - bundle exec rake + bundle install --jobs 4 --retry 3 - name: Setup Database run: | From f0220c536290b85ede0a4f8e624ce27c084d37cb Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:14:02 -0600 Subject: [PATCH 08/12] Fix: moved to correct folder --- {.github => job_tracker/.github}/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) rename {.github => job_tracker/.github}/workflows/ci.yml (97%) diff --git a/.github/workflows/ci.yml b/job_tracker/.github/workflows/ci.yml similarity index 97% rename from .github/workflows/ci.yml rename to job_tracker/.github/workflows/ci.yml index 9f85591..b099960 100644 --- a/.github/workflows/ci.yml +++ b/job_tracker/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: - name: Bundle install run: | gem install bundler - cd job_tracker bundle install --jobs 4 --retry 3 - name: Setup Database From 5fdc10c2bd057a79368ba71f85be5c693b2089f9 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:16:28 -0600 Subject: [PATCH 09/12] Fix: moved back and added cd commands --- {job_tracker/.github => .github}/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename {job_tracker/.github => .github}/workflows/ci.yml (88%) diff --git a/job_tracker/.github/workflows/ci.yml b/.github/workflows/ci.yml similarity index 88% rename from job_tracker/.github/workflows/ci.yml rename to .github/workflows/ci.yml index b099960..72b89e7 100644 --- a/job_tracker/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,12 @@ jobs: - name: Bundle install run: | gem install bundler + cd job_tracker bundle install --jobs 4 --retry 3 - name: Setup Database run: | + cd job_tracker cp config/database.yml.github-actions config/database.yml bundle exec rake db:create bundle exec rake db:schema:load @@ -39,7 +41,9 @@ jobs: POSTGRES_PASSWORD: postgres - name: Run RSpec - run: COVERAGE=true bundle exec rspec --require rails_helper + run: | + cd job_tracker + COVERAGE=true bundle exec rspec --require rails_helper env: RAILS_ENV: test POSTGRES_USER: postgres From 8e0aeedea0b6b16885abe1dac3d917a20f403e8a Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Mon, 5 Feb 2024 22:21:54 -0600 Subject: [PATCH 10/12] Removed: old articles files --- job_tracker/spec/requests/articles_spec.rb | 11 ----------- .../spec/views/articles/index.html.erb_spec.rb | 5 ----- 2 files changed, 16 deletions(-) delete mode 100644 job_tracker/spec/requests/articles_spec.rb delete mode 100644 job_tracker/spec/views/articles/index.html.erb_spec.rb diff --git a/job_tracker/spec/requests/articles_spec.rb b/job_tracker/spec/requests/articles_spec.rb deleted file mode 100644 index 3484a0e..0000000 --- a/job_tracker/spec/requests/articles_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.describe "Articles", type: :request do - describe "GET /index" do - it "returns http success" do - get "/articles/index" - expect(response).to have_http_status(:success) - end - end - -end diff --git a/job_tracker/spec/views/articles/index.html.erb_spec.rb b/job_tracker/spec/views/articles/index.html.erb_spec.rb deleted file mode 100644 index eacda55..0000000 --- a/job_tracker/spec/views/articles/index.html.erb_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe "articles/index.html.erb", type: :view do - pending "add some examples to (or delete) #{__FILE__}" -end From fc5ce6c39a85db2419ddbd41bf61e62499397298 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Tue, 6 Feb 2024 00:11:36 -0600 Subject: [PATCH 11/12] Update: Pass specs for major render paths --- job_tracker/spec/requests/home_spec.rb | 2 +- .../routing/job_descriptions_routing_spec.rb | 4 +-- .../views/employers/edit.html.erb_spec.rb | 25 ++++++++++++------- .../views/employers/index.html.erb_spec.rb | 22 ++++++++-------- .../spec/views/employers/new.html.erb_spec.rb | 16 ++++++++---- .../job_applications/edit.html.erb_spec.rb | 10 +++++++- .../job_applications/index.html.erb_spec.rb | 13 ++++++++-- .../job_applications/show.html.erb_spec.rb | 14 +++++++++-- .../job_descriptions/edit.html.erb_spec.rb | 7 ++++-- .../job_descriptions/index.html.erb_spec.rb | 22 +++++++++------- .../job_descriptions/new.html.erb_spec.rb | 7 ++++-- .../job_descriptions/show.html.erb_spec.rb | 5 +++- 12 files changed, 100 insertions(+), 47 deletions(-) diff --git a/job_tracker/spec/requests/home_spec.rb b/job_tracker/spec/requests/home_spec.rb index fdbd642..29b8e07 100644 --- a/job_tracker/spec/requests/home_spec.rb +++ b/job_tracker/spec/requests/home_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "Homes", type: :request do describe "GET /index" do it "returns http success" do - get "/home/index" + get "/home#index" expect(response).to have_http_status(:success) end end diff --git a/job_tracker/spec/routing/job_descriptions_routing_spec.rb b/job_tracker/spec/routing/job_descriptions_routing_spec.rb index a6d3e53..4945ef5 100644 --- a/job_tracker/spec/routing/job_descriptions_routing_spec.rb +++ b/job_tracker/spec/routing/job_descriptions_routing_spec.rb @@ -31,8 +31,8 @@ expect(patch: "/job_descriptions/1").to route_to("job_descriptions#update", id: "1") end - it "routes to #destroy" do - expect(delete: "/job_descriptions/1").to route_to("job_descriptions#destroy", id: "1") + it "does not routes to #destroy" do + expect(delete: "/job_descriptions/1").to_not route_to("job_descriptions#destroy", id: "1") end end end diff --git a/job_tracker/spec/views/employers/edit.html.erb_spec.rb b/job_tracker/spec/views/employers/edit.html.erb_spec.rb index 7b720d9..e1469bf 100644 --- a/job_tracker/spec/views/employers/edit.html.erb_spec.rb +++ b/job_tracker/spec/views/employers/edit.html.erb_spec.rb @@ -6,26 +6,33 @@ name: "MyString", phone_number: "MyString", email: "MyString", - address: "" + address: { "street" => "MyStreet1234", "city" => "MyCity", "state" => "MyState", "zip" => 00005} ) } before(:each) do assign(:employer, employer) + render end it "renders the edit employer form" do render assert_select "form[action=?][method=?]", employer_path(employer), "post" do - - assert_select "input[name=?]", "employer[name]" - - assert_select "input[name=?]", "employer[phone_number]" - - assert_select "input[name=?]", "employer[email]" - - assert_select "input[name=?]", "employer[address]" + + assert_select "input[name=?]", "employer[name]" + + assert_select "input[name=?]", "employer[phone_number]" + + assert_select "input[name=?]", "employer[email]" + + assert_select "input[name=?]", "employer[address][street]" + + assert_select "input[name=?]", "employer[address][city]" + + assert_select "input[name=?]", "employer[address][state]" + + assert_select "input[name=?]", "employer[address][zip]" end end end diff --git a/job_tracker/spec/views/employers/index.html.erb_spec.rb b/job_tracker/spec/views/employers/index.html.erb_spec.rb index 5d29386..ed90b1b 100644 --- a/job_tracker/spec/views/employers/index.html.erb_spec.rb +++ b/job_tracker/spec/views/employers/index.html.erb_spec.rb @@ -4,26 +4,26 @@ before(:each) do assign(:employers, [ Employer.create!( - name: "Name", - phone_number: "Phone Number", + name: "Example", email: "Email", - address: "" + phone_number: "1234567890", + address: { "street" => "MyStreet1234", "city" => "MyCity", "state" => "MyState", "zip" => 00005} ), Employer.create!( - name: "Name", - phone_number: "Phone Number", + name: "Example", email: "Email", - address: "" + phone_number: "1234567890", + address: { "street" => "MyStreet1234", "city" => "MyCity", "state" => "MyState", "zip" => 00005} ) ]) end it "renders a list of employers" do render - cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td' - assert_select cell_selector, text: Regexp.new("Name".to_s), count: 2 - assert_select cell_selector, text: Regexp.new("Phone Number".to_s), count: 2 - assert_select cell_selector, text: Regexp.new("Email".to_s), count: 2 - assert_select cell_selector, text: Regexp.new("".to_s), count: 2 + + assert_select "h2", text: "Name: Example", count: 2 + assert_select "div>b", text: "Email:", count: 2 + assert_select "div>b", text: "Phone Number:", count: 2 + assert_select "div>b", text: "Address:", count: 2 end end diff --git a/job_tracker/spec/views/employers/new.html.erb_spec.rb b/job_tracker/spec/views/employers/new.html.erb_spec.rb index e80bce7..9aca9af 100644 --- a/job_tracker/spec/views/employers/new.html.erb_spec.rb +++ b/job_tracker/spec/views/employers/new.html.erb_spec.rb @@ -3,10 +3,10 @@ RSpec.describe "employers/new", type: :view do before(:each) do assign(:employer, Employer.new( - name: "MyString", - phone_number: "MyString", - email: "MyString", - address: "" + name: "MyName", + phone_number: "1234567890", + email: "Email@gmail.com", + address: { "street" => "MyStreet", "city" => "MyCity", "state" => "MyState", "zip" => 12345 } )) end @@ -21,7 +21,13 @@ assert_select "input[name=?]", "employer[email]" - assert_select "input[name=?]", "employer[address]" + assert_select "input[name=?]", "employer[address][street]" + + assert_select "input[name=?]", "employer[address][city]" + + assert_select "input[name=?]", "employer[address][state]" + + assert_select "input[name=?]", "employer[address][zip]" end end end diff --git a/job_tracker/spec/views/job_applications/edit.html.erb_spec.rb b/job_tracker/spec/views/job_applications/edit.html.erb_spec.rb index 7a9eb4e..cb73cb1 100644 --- a/job_tracker/spec/views/job_applications/edit.html.erb_spec.rb +++ b/job_tracker/spec/views/job_applications/edit.html.erb_spec.rb @@ -1,8 +1,16 @@ require 'rails_helper' RSpec.describe "job_applications/edit", type: :view do + let(:employer) { + Employer.create!( + name: "MyName", + phone_number: "1234567890", + email: "", + address: { "street" => "MyStreet", "city" => "MyCity", "state" => "MyState", "zip" => 12345 } + ) + } let(:job_application) { - JobApplication.create!() + JobApplication.create!(employer: employer) } before(:each) do diff --git a/job_tracker/spec/views/job_applications/index.html.erb_spec.rb b/job_tracker/spec/views/job_applications/index.html.erb_spec.rb index c1bf41b..cf3ca3c 100644 --- a/job_tracker/spec/views/job_applications/index.html.erb_spec.rb +++ b/job_tracker/spec/views/job_applications/index.html.erb_spec.rb @@ -1,10 +1,19 @@ require 'rails_helper' RSpec.describe "job_applications/index", type: :view do + let(:employer) { + Employer.create!( + name: "MyName", + phone_number: "1234567890", + email: "", + address: { "street" => "MyStreet", "city" => "MyCity", "state" => "MyState", "zip" => 12345 } + ) + } + before(:each) do assign(:job_applications, [ - JobApplication.create!(), - JobApplication.create!() + JobApplication.create!(employer: employer), + JobApplication.create!(employer: employer) ]) end diff --git a/job_tracker/spec/views/job_applications/show.html.erb_spec.rb b/job_tracker/spec/views/job_applications/show.html.erb_spec.rb index 7602895..0319f45 100644 --- a/job_tracker/spec/views/job_applications/show.html.erb_spec.rb +++ b/job_tracker/spec/views/job_applications/show.html.erb_spec.rb @@ -1,11 +1,21 @@ require 'rails_helper' RSpec.describe "job_applications/show", type: :view do + let(:employer) { Employer.create!(name: "MyString") } + let(:job_application) { JobApplication.create!(employer: employer) } + let(:job_description) { JobDescription.create!(job_application: job_application) } + + before(:each) do - assign(:job_application, JobApplication.create!()) + job_application.job_description = job_description + assign(:job_application, job_application) end - it "renders attributes in

" do + it "renders attributes" do render + + assert_select "h1>b", text: "Title:", count: 1 + assert_select "div>b", text: "Employer:", count: 1 + assert_select "div>b", text: "Status:", count: 1 end end diff --git a/job_tracker/spec/views/job_descriptions/edit.html.erb_spec.rb b/job_tracker/spec/views/job_descriptions/edit.html.erb_spec.rb index eb4edf6..0518d6c 100644 --- a/job_tracker/spec/views/job_descriptions/edit.html.erb_spec.rb +++ b/job_tracker/spec/views/job_descriptions/edit.html.erb_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.describe "job_descriptions/edit", type: :view do + let(:employer) { Employer.create!(name: "MyString") } + let(:job_application) { JobApplication.create!(employer: employer) } + let(:job_description) { JobDescription.create!( description: "MyText", @@ -8,7 +11,7 @@ job_classification: "MyString", min_salary: 1, max_salary: 1, - job_application: nil + job_application: job_application ) } @@ -31,7 +34,7 @@ assert_select "input[name=?]", "job_description[max_salary]" - assert_select "input[name=?]", "job_description[job_application_id]" + assert_select "select[name=?]", "job_description[job_application_id]" end end end diff --git a/job_tracker/spec/views/job_descriptions/index.html.erb_spec.rb b/job_tracker/spec/views/job_descriptions/index.html.erb_spec.rb index 793d7a9..c5c4ea4 100644 --- a/job_tracker/spec/views/job_descriptions/index.html.erb_spec.rb +++ b/job_tracker/spec/views/job_descriptions/index.html.erb_spec.rb @@ -1,6 +1,10 @@ require 'rails_helper' RSpec.describe "job_descriptions/index", type: :view do + let(:employer) { Employer.create!(name: "MyString") } + let(:job_application1) { JobApplication.create!(employer: employer) } + let(:job_application2) { JobApplication.create!(employer: employer) } + before(:each) do assign(:job_descriptions, [ JobDescription.create!( @@ -9,7 +13,7 @@ job_classification: "Job Classification", min_salary: 2, max_salary: 3, - job_application: nil + job_application: job_application1 ), JobDescription.create!( description: "MyText", @@ -17,19 +21,19 @@ job_classification: "Job Classification", min_salary: 2, max_salary: 3, - job_application: nil + job_application: job_application2 ) ]) end it "renders a list of job_descriptions" do render - cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td' - assert_select cell_selector, text: Regexp.new("MyText".to_s), count: 2 - assert_select cell_selector, text: Regexp.new("MyText".to_s), count: 2 - assert_select cell_selector, text: Regexp.new("Job Classification".to_s), count: 2 - assert_select cell_selector, text: Regexp.new(2.to_s), count: 2 - assert_select cell_selector, text: Regexp.new(3.to_s), count: 2 - assert_select cell_selector, text: Regexp.new(nil.to_s), count: 2 + + assert_select "div>h2", text: Regexp.new("Job application:".to_s), count: 2 + assert_select "div>p", text: Regexp.new("Description:".to_s), count: 2 + assert_select "div>p", text: Regexp.new("Requirements".to_s), count: 2 + assert_select "div>p", text: Regexp.new("Job classification".to_s), count: 2 + assert_select "div>p", text: Regexp.new("Min salary:"), count: 2 + assert_select "div>p", text: Regexp.new("Max salary:"), count: 2 end end diff --git a/job_tracker/spec/views/job_descriptions/new.html.erb_spec.rb b/job_tracker/spec/views/job_descriptions/new.html.erb_spec.rb index 3eae6bb..41b92c1 100644 --- a/job_tracker/spec/views/job_descriptions/new.html.erb_spec.rb +++ b/job_tracker/spec/views/job_descriptions/new.html.erb_spec.rb @@ -1,6 +1,9 @@ require 'rails_helper' RSpec.describe "job_descriptions/new", type: :view do + let(:employer) { Employer.create!(name: "MyString") } + let(:job_application) { JobApplication.create!(employer: employer) } + before(:each) do assign(:job_description, JobDescription.new( description: "MyText", @@ -8,7 +11,7 @@ job_classification: "MyString", min_salary: 1, max_salary: 1, - job_application: nil + job_application_id: job_application.id )) end @@ -27,7 +30,7 @@ assert_select "input[name=?]", "job_description[max_salary]" - assert_select "input[name=?]", "job_description[job_application_id]" + assert_select "select[name=?]", "job_description[job_application_id]" end end end diff --git a/job_tracker/spec/views/job_descriptions/show.html.erb_spec.rb b/job_tracker/spec/views/job_descriptions/show.html.erb_spec.rb index e229ed6..8745c9a 100644 --- a/job_tracker/spec/views/job_descriptions/show.html.erb_spec.rb +++ b/job_tracker/spec/views/job_descriptions/show.html.erb_spec.rb @@ -1,14 +1,17 @@ require 'rails_helper' RSpec.describe "job_descriptions/show", type: :view do + let(:employer) { Employer.create!(name: "MyString") } + let(:job_application) { JobApplication.create!(employer: employer) } before(:each) do + assign(:job_description, JobDescription.create!( description: "MyText", requirements: "MyText", job_classification: "Job Classification", min_salary: 2, max_salary: 3, - job_application: nil + job_application: job_application )) end From 87e5a4c59b46876568af48a2c09716b93ac4ae78 Mon Sep 17 00:00:00 2001 From: Aiden Escamilla Date: Tue, 6 Feb 2024 00:17:25 -0600 Subject: [PATCH 12/12] add assets:precomplie --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72b89e7..83407c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: - name: Run RSpec run: | cd job_tracker + rails assets:precompile COVERAGE=true bundle exec rspec --require rails_helper env: RAILS_ENV: test