-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from AidenEscamilla/setup_github_workflow
Added: Automatic spec testing w/ github actions Note: 2000 minutes/per month free and (or?) 500 MB
- Loading branch information
Showing
16 changed files
with
159 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:14.10 | ||
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@v4 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
bundler-cache: true | ||
|
||
- name: Install dependent libraries | ||
run: sudo apt-get install libpq-dev | ||
|
||
- 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 | ||
env: | ||
RAILS_ENV: test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
|
||
- name: Run RSpec | ||
run: | | ||
cd job_tracker | ||
rails assets:precompile | ||
COVERAGE=true bundle exec rspec --require rails_helper | ||
env: | ||
RAILS_ENV: test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test: | ||
adapter: postgresql | ||
host: localhost | ||
encoding: unicode | ||
database: github-actions | ||
pool: 20 | ||
username: <%= ENV["POSTGRES_USER"] %> | ||
password: <%= ENV["POSTGRES_PASSWORD"] %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 protected]", | ||
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 |
10 changes: 9 additions & 1 deletion
10
job_tracker/spec/views/job_applications/edit.html.erb_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
job_tracker/spec/views/job_applications/index.html.erb_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
job_tracker/spec/views/job_applications/show.html.erb_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <p>" 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters