From 596f23a7e5581500eed2108ac8fdaffa883d4440 Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 14:20:37 -0600 Subject: [PATCH 1/7] Add seed file --- db/seeds.rb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index f3a0480d1..ae87bd52e 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,39 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) +PetApplication.destroy_all +Application.destroy_all +Pet.destroy_all +Shelter.destroy_all +#shelters +@shelter_1 = Shelter.create(name: 'Denver Dumb Friends Leauge', city: 'Denver, CO', foster_program: true, rank: 8) +@shelter_2 = Shelter.create(name: 'Rocky Mountain Puppy Rescue', city: 'Westminster, CO', foster_program: true, rank: 9) + +#pets +@pet_1 = Pet.create!(adoptable: true, age: 7, breed: 'dane-shepard', name: 'Koop', shelter_id: @shelter_2.id) +@pet_2 = Pet.create!(adoptable: true, age: 9, breed: 'pitbull', name: 'Nola', shelter_id: @shelter_1.id) +@pet_3 = Pet.create!(adoptable: true, age: 6, breed: 'lab', name: 'Mona', shelter_id: @shelter_1.id) +@pet_4 = Pet.create!(adoptable: true, age: 1, breed: 'retriever/mix', name: 'Miley', shelter_id: @shelter_2.id) +@pet_5 = Pet.create!(adoptable: true, age: 3, breed: 'saint bernard', name: 'Truck', shelter_id: @shelter_2.id) +@pet_6 = Pet.create!(adoptable: true, age: 4, breed: 'australian shepard', name: 'Jackson', shelter_id: @shelter_2.id) + +#applications +@application_1 = Application.create!(name: 'Isabella', address: '1234 Drive', city: 'Denver', state: 'CO', zip_code: 80221, description: 'I want a friend', status: 'In Progress') +@application_2 = Application.create!(name: 'Molly', address: '6831 ', city: 'Aurora', state: 'CO', zip_code: 80023, description: 'My other dog wants a friend', status: 'Approved') +@application_3 = Application.create!(name: 'Fiona', address: '1215 Perrine', city: 'Rawlins', state: 'WY', zip_code: 82301, description: 'I want a puppy', status: 'In Progress') +@application_4 = Application.create!(name: 'Felipe', address: '6835 Carrick Dr', city: 'Fort Collins', state: 'CO', zip_code: 80525, description: 'I would be the best dog parent!', status: 'Pending') +@application_5 = Application.create!(name: 'Bailey', address: '2323 Platte Street', city: 'Saratoga', state: 'WY', zip_code: 82311, description: 'I want a puppy', status: 'Pending') + +#pet_applications +PetApplication.create!(pet: @pet_2, application: @application_1) +PetApplication.create!(pet: @pet_3, application: @application_1) +PetApplication.create!(pet: @pet_5, application: @application_1) +PetApplication.create!(pet: @pet_2, application: @application_2) +PetApplication.create!(pet: @pet_3, application: @application_2) +PetApplication.create!(pet: @pet_4, application: @application_2) +PetApplication.create!(pet: @pet_4, application: @application_3) +PetApplication.create!(pet: @pet_6, application: @application_3) +PetApplication.create!(pet: @pet_1, application: @application_4) +PetApplication.create!(pet: @pet_3, application: @application_4) +PetApplication.create!(pet: @pet_5, application: @application_4) +PetApplication.create!(pet: @pet_6, application: @application_5) From ecc644d0d5f99c8600c01a733b033861aba2244e Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 14:22:14 -0600 Subject: [PATCH 2/7] Complete user story (#6) --- app/controllers/applications_controller.rb | 6 ++++ app/views/applications/show.html.erb | 18 ++++++++-- spec/features/applications/show_spec.rb | 40 +++++++++++++++++++--- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/app/controllers/applications_controller.rb b/app/controllers/applications_controller.rb index 20c07be2c..433b854d6 100644 --- a/app/controllers/applications_controller.rb +++ b/app/controllers/applications_controller.rb @@ -5,6 +5,12 @@ def index def show @application = Application.find(params[:id]) + + if params[:search].present? + @searched_pets = Pet.search(params[:search]) + else + @searched_pets = [] + end end def new diff --git a/app/views/applications/show.html.erb b/app/views/applications/show.html.erb index f3cf1234c..575bf74f3 100644 --- a/app/views/applications/show.html.erb +++ b/app/views/applications/show.html.erb @@ -1,10 +1,24 @@ +
+ <%= form_with url: "/applications/#{@application.id}", method: :get, local: true do |f| %> + <%= f.label :search, "Search by pet name:" %> + <%= f.text_field :search %> + <%= f.submit "Search" %> + <% end %> +
+
+<% if @searched_pets.any? == true %> + <% @searched_pets.each do |pet| %> + <%= pet.name %> <%= button_to "Adopt this Pet", "/applications/#{@application.id}", method: :patch%> + <% end %> +<% end %> +

<%= @application.name %>

Address: <%= @application.address %>

City: <%= @application.city %>

State: <%= @application.state %>

Zip Code: <%= @application.zip_code %>

-

Description: <%= @application.description %>

+

Pet(s):

<% @application.pets.each do |pet| %> -

Pet(s): <%= link_to "#{pet.name}", "/pets/#{pet.id}" %>

+ <%= link_to "#{pet.name}", "/pets/#{pet.id}" %> <% end %>

Application Status: <%= @application.status %>

diff --git a/spec/features/applications/show_spec.rb b/spec/features/applications/show_spec.rb index 0ac47a1c3..528e4c714 100644 --- a/spec/features/applications/show_spec.rb +++ b/spec/features/applications/show_spec.rb @@ -6,6 +6,8 @@ @pet_1 = Pet.create!(adoptable: true, age: 1, breed: 'sphynx', name: 'Lucille Bald', shelter_id: @shelter.id) @pet_2 = Pet.create!(adoptable: true, age: 3, breed: 'doberman', name: 'Lobster', shelter_id: @shelter.id) @pet_3 = Pet.create!(adoptable: true, age: 4, breed: 'chihuahua', name: 'Elle', shelter_id: @shelter.id) + @pet_4 = Pet.create!(adoptable: true, age: 1, breed: 'retriever/mix', name: 'Miley', shelter_id: @shelter_2.id) + @application_1 = Application.create!(name: 'Ashley', address: '1215 Perrine', city: 'Rawlins', state: 'WY', zip_code: 82301, description: 'I want a puppy', status: 'In Progress') @@ -21,10 +23,9 @@ expect(page).to have_content("City: #{@application_1.city}") expect(page).to have_content("State: #{@application_1.state}") expect(page).to have_content("Zip Code: #{@application_1.zip_code}") - expect(page).to have_content("Description: #{@application_1.description}") - expect(page).to_not have_content("Pet(s): #{@pet_1.name}") - expect(page).to have_content("Pet(s): #{@pet_2.name}") - expect(page).to have_content("Pet(s): #{@pet_3.name}") + expect(page).to_not have_content("#{@pet_1.name}") + find_link("#{@pet_2.name}") + find_link("#{@pet_3.name}") expect(page).to have_content("Application Status: #{@application_1.status}") end @@ -35,4 +36,35 @@ expect(current_path).to eq("/pets/#{@pet_2.id}") end + + it 'has a text box to filter results by keyword' do + visit "/applications/#{@application_1.id}" + + expect(page).to have_button("Search") + end + + it 'lists partial matches of search results' do + visit "/applications/#{@application_1.id}" + + fill_in 'Search by pet name:', with: "Lucille" + click_on("Search") + + expect(current_path).to eq("/applications/#{@application_1.id}") + expect(@pet_1.name).to appear_before(@pet_3.name) + end + + it 'displays button next to searched pets' do + visit "/applications/#{@application_1.id}" + + fill_in 'Search by pet name:', with: "Lucille" + click_on("Search") + fill_in 'Search by pet name:', with: "Miley" + click_on("Search") + + expect(page).to have_button("Adopt this Pet") + end + + xit 'add pet to pets list on the application when button selected' do + + end end From 8b3d7442a3e462d1fdf9a325286da0ce00b836a9 Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 15:28:28 -0600 Subject: [PATCH 3/7] remove applications index spec --- spec/features/applications/index_spec.rb | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 spec/features/applications/index_spec.rb diff --git a/spec/features/applications/index_spec.rb b/spec/features/applications/index_spec.rb deleted file mode 100644 index 4f56a1c6e..000000000 --- a/spec/features/applications/index_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'the applications index' do - before :each do - shelter = Shelter.create(name: 'Aurora shelter', city: 'Aurora, CO', foster_program: false, rank: 9) - pet_1 = Pet.create(adoptable: true, age: 1, breed: 'sphynx', name: 'Lucille Bald', shelter_id: shelter.id) - pet_2 = Pet.create(adoptable: true, age: 3, breed: 'doberman', name: 'Lobster', shelter_id: shelter.id) - pet_3 = Pet.create(adoptable: true, age: 4, breed: 'chihuahua', name: 'Elle', shelter_id: shelter.id) - - end -end From 61cd14cdf0e0a73175f596e052ba3c5710848f7a Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 15:29:21 -0600 Subject: [PATCH 4/7] User story (#7) --- app/controllers/applications_controller.rb | 12 +++++-- app/views/applications/show.html.erb | 23 +++++++----- config/routes.rb | 1 + spec/features/applications/show_spec.rb | 17 +-------- spec/features/applications/update_spec.rb | 41 ++++++++++++++++++++++ 5 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 spec/features/applications/update_spec.rb diff --git a/app/controllers/applications_controller.rb b/app/controllers/applications_controller.rb index 433b854d6..4941d7769 100644 --- a/app/controllers/applications_controller.rb +++ b/app/controllers/applications_controller.rb @@ -1,8 +1,5 @@ class ApplicationsController < ApplicationController - def index - end - def show @application = Application.find(params[:id]) @@ -27,6 +24,15 @@ def create end end + def update + application = Application.find(params[:id]) + if params[:pet_id] + pet = Pet.find(params[:pet_id]) + PetApplication.create(pet: pet, application: application) + redirect_to "/applications/#{application.id}" + end + end + private def application_params params.permit(:name, :address, :city, :state, :zip_code, :description, :status) diff --git a/app/views/applications/show.html.erb b/app/views/applications/show.html.erb index 575bf74f3..eef92b909 100644 --- a/app/views/applications/show.html.erb +++ b/app/views/applications/show.html.erb @@ -1,17 +1,22 @@ -
- <%= form_with url: "/applications/#{@application.id}", method: :get, local: true do |f| %> - <%= f.label :search, "Search by pet name:" %> - <%= f.text_field :search %> - <%= f.submit "Search" %> - <% end %> -
+

Add a Pet to this Application

+<%= form_with url: "/applications/#{@application.id}", method: :get, local: true do |f| %> + <%= f.label :search, "Search by pet name:" %> + <%= f.text_field :search %> + <%= f.submit "Search" %> +<% end %> +
+ <% if @searched_pets.any? == true %> <% @searched_pets.each do |pet| %> - <%= pet.name %> <%= button_to "Adopt this Pet", "/applications/#{@application.id}", method: :patch%> - <% end %> +
+ <%= pet.name %> + <%= button_to "Adopt this Pet", "/applications/#{@application.id}?pet_id=#{pet.id}", method: :patch%> + <% end %> +
<% end %> +

<%= @application.name %>

Address: <%= @application.address %>

City: <%= @application.city %>

diff --git a/config/routes.rb b/config/routes.rb index 9e20a35fe..0c03b5369 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -41,5 +41,6 @@ get '/applications/new', to: 'applications#new' get '/applications/:id', to: 'applications#show' post '/applications', to: 'applications#create' + patch '/applications/:id', to: 'applications#update' end diff --git a/spec/features/applications/show_spec.rb b/spec/features/applications/show_spec.rb index 528e4c714..7a1e3a3f9 100644 --- a/spec/features/applications/show_spec.rb +++ b/spec/features/applications/show_spec.rb @@ -6,7 +6,7 @@ @pet_1 = Pet.create!(adoptable: true, age: 1, breed: 'sphynx', name: 'Lucille Bald', shelter_id: @shelter.id) @pet_2 = Pet.create!(adoptable: true, age: 3, breed: 'doberman', name: 'Lobster', shelter_id: @shelter.id) @pet_3 = Pet.create!(adoptable: true, age: 4, breed: 'chihuahua', name: 'Elle', shelter_id: @shelter.id) - @pet_4 = Pet.create!(adoptable: true, age: 1, breed: 'retriever/mix', name: 'Miley', shelter_id: @shelter_2.id) + @pet_4 = Pet.create!(adoptable: true, age: 1, breed: 'retriever/mix', name: 'Miley', shelter_id: @shelter.id) @application_1 = Application.create!(name: 'Ashley', address: '1215 Perrine', city: 'Rawlins', state: 'WY', zip_code: 82301, description: 'I want a puppy', status: 'In Progress') @@ -52,19 +52,4 @@ expect(current_path).to eq("/applications/#{@application_1.id}") expect(@pet_1.name).to appear_before(@pet_3.name) end - - it 'displays button next to searched pets' do - visit "/applications/#{@application_1.id}" - - fill_in 'Search by pet name:', with: "Lucille" - click_on("Search") - fill_in 'Search by pet name:', with: "Miley" - click_on("Search") - - expect(page).to have_button("Adopt this Pet") - end - - xit 'add pet to pets list on the application when button selected' do - - end end diff --git a/spec/features/applications/update_spec.rb b/spec/features/applications/update_spec.rb new file mode 100644 index 000000000..d2d5b3553 --- /dev/null +++ b/spec/features/applications/update_spec.rb @@ -0,0 +1,41 @@ +require 'rails_helper' + +RSpec.describe 'the applications updates' do + before :each do + @shelter = Shelter.create(name: 'Mystery Building', city: 'Irvine CA', foster_program: false, rank: 9) + @pet_1 = Pet.create!(adoptable: true, age: 1, breed: 'sphynx', name: 'Lucille Bald', shelter_id: @shelter.id) + @pet_2 = Pet.create!(adoptable: true, age: 3, breed: 'doberman', name: 'Lobster', shelter_id: @shelter.id) + @pet_3 = Pet.create!(adoptable: true, age: 4, breed: 'chihuahua', name: 'Elle', shelter_id: @shelter.id) + @pet_4 = Pet.create!(adoptable: true, age: 1, breed: 'retriever/mix', name: 'Miley', shelter_id: @shelter.id) + + + @application_1 = Application.create!(name: 'Ashley', address: '1215 Perrine', city: 'Rawlins', state: 'WY', zip_code: 82301, description: 'I want a puppy', status: 'In Progress') + + PetApplication.create!(pet: @pet_2, application: @application_1) + PetApplication.create!(pet: @pet_3, application: @application_1) + end + + it 'displays button next to searched pets' do + visit "/applications/#{@application_1.id}" + + fill_in 'Search by pet name:', with: "Miley" + click_on("Search") + + expect(page).to have_button("Adopt this Pet") + end + + it 'add pet to pets list on the application when button selected' do + visit "/applications/#{@application_1.id}" + + fill_in 'Search by pet name:', with: "Miley" + click_on("Search") + + within("#searched_pets-#{@pet_4.id}") do + click_button('Adopt this Pet') + end + save_and_open_page + expect(current_path).to eq("/applications/#{@application_1.id}") + find_link("#{@pet_4.name}") + end + +end From d4a207453a064b5319db2697aff54e772b8afa0e Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 16:03:56 -0600 Subject: [PATCH 5/7] User story (#8) --- app/controllers/applications_controller.rb | 4 ++++ app/views/applications/show.html.erb | 5 +++++ spec/features/applications/update_spec.rb | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/controllers/applications_controller.rb b/app/controllers/applications_controller.rb index 4941d7769..5c80c9176 100644 --- a/app/controllers/applications_controller.rb +++ b/app/controllers/applications_controller.rb @@ -26,10 +26,14 @@ def create def update application = Application.find(params[:id]) + if params[:pet_id] pet = Pet.find(params[:pet_id]) PetApplication.create(pet: pet, application: application) redirect_to "/applications/#{application.id}" + elsif params[:status] + application.update(status: params[:status]) + redirect_to "/applications/#{application.id}" end end diff --git a/app/views/applications/show.html.erb b/app/views/applications/show.html.erb index eef92b909..08962c0a9 100644 --- a/app/views/applications/show.html.erb +++ b/app/views/applications/show.html.erb @@ -27,3 +27,8 @@ <%= link_to "#{pet.name}", "/pets/#{pet.id}" %> <% end %>

Application Status: <%= @application.status %>

+ +<% if @application.pets != [] %> + <%= button_to "Submit Application", "/applications/#{@application.id}?status=Pending", method: :patch%> + <% else @application.pets == []%> +<% end %> diff --git a/spec/features/applications/update_spec.rb b/spec/features/applications/update_spec.rb index d2d5b3553..1b95aa85f 100644 --- a/spec/features/applications/update_spec.rb +++ b/spec/features/applications/update_spec.rb @@ -33,9 +33,24 @@ within("#searched_pets-#{@pet_4.id}") do click_button('Adopt this Pet') end - save_and_open_page + expect(current_path).to eq("/applications/#{@application_1.id}") find_link("#{@pet_4.name}") end + it 'displays a "Submit Application" button when application has pets' do + visit "/applications/#{@application_1.id}" + + expect(page).to have_button("Submit Application") + end + + it 'updates application to "Pending" when the "Submit Application" is pushed' do + visit "/applications/#{@application_1.id}" + + click_button('Submit Application') + + expect(current_path).to eq("/applications/#{@application_1.id}") + expect(page).to have_content("Application Status: Pending") + end + end From 31853a5d25e732d8d51683597f7cd4eb926fa3a1 Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 16:11:22 -0600 Subject: [PATCH 6/7] update user stories --- README.md | 32 ++++++++++++------------- spec/features/applications/show_spec.rb | 14 ++++++++--- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9e9d64e54..68e1acfbf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ During your Check In, you should be prepared to review your database schema for ## Evaluation -Before your evaluation, choose 2 user stories to present in a small group. Try to pick user stories that you think will deliever the highest value in terms of feedback from the instructor and peers. +Before your evaluation, choose 2 user stories to present in a small group. Try to pick user stories that you think will deliever the highest value in terms of feedback from the instructor and peers. During the evaluation, you will present your user story: @@ -45,7 +45,7 @@ During the evaluation, you will present your user story: ## Deploy ``` -[ ] done +[X] done Deploy your application to Heroku @@ -63,8 +63,8 @@ Use these guides: https://devcenter.heroku.com/articles/getting-started-with-rai Visitors to the site will be able to create applications to adopt pets. An application has many pets. Pets can have many applications. ``` -[ ] done - +[X] done +User Story 3 Application Show Page As a visitor @@ -78,10 +78,10 @@ Then I can see the following: ``` ``` -[ ] done +[X] done Starting an Application - +User Story 4 As a visitor When I visit the pet index page Then I see a link to "Start an Application" @@ -100,8 +100,8 @@ And I see an indicator that this application is "In Progress" ``` ``` -[ ] done - +[X] done +User Story 5 Starting an Application, Form not Completed As a visitor @@ -113,8 +113,8 @@ And I see a message that I must fill in those fields. ``` ``` -[ ] done - +[X] done +User Story 6 Searching for Pets for an Application As a visitor @@ -129,8 +129,8 @@ And under the search bar I see any Pet whose name matches my search ``` ``` -[ ] done - +[X] done +User Story 7 Add a Pet to an Application As a visitor @@ -144,8 +144,8 @@ And I see the Pet I want to adopt listed on this application ``` ``` -[ ] done - +[X] done +User Story 8 Submit an Application As a visitor @@ -162,8 +162,8 @@ And I do not see a section to add more pets to this application ``` ``` -[ ] done - +[X] done +User Story 9 No Pets on an Application As a visitor diff --git a/spec/features/applications/show_spec.rb b/spec/features/applications/show_spec.rb index 7a1e3a3f9..99997f1c7 100644 --- a/spec/features/applications/show_spec.rb +++ b/spec/features/applications/show_spec.rb @@ -10,6 +10,8 @@ @application_1 = Application.create!(name: 'Ashley', address: '1215 Perrine', city: 'Rawlins', state: 'WY', zip_code: 82301, description: 'I want a puppy', status: 'In Progress') + @application_2 = Application.create!(name: 'Sarah', address: '8734 Drive Dr', city: 'Denver', state: 'CO', zip_code: 80221, description: 'I love dogs!', status: 'In Progress') + PetApplication.create!(pet: @pet_2, application: @application_1) PetApplication.create!(pet: @pet_3, application: @application_1) @@ -28,7 +30,7 @@ find_link("#{@pet_3.name}") expect(page).to have_content("Application Status: #{@application_1.status}") end - + #User story 3 it 'had link to pet show page from pet name' do visit "/applications/#{@application_1.id}" @@ -36,13 +38,13 @@ expect(current_path).to eq("/pets/#{@pet_2.id}") end - + #User story 6 it 'has a text box to filter results by keyword' do visit "/applications/#{@application_1.id}" expect(page).to have_button("Search") end - + #User story 6 it 'lists partial matches of search results' do visit "/applications/#{@application_1.id}" @@ -52,4 +54,10 @@ expect(current_path).to eq("/applications/#{@application_1.id}") expect(@pet_1.name).to appear_before(@pet_3.name) end + #User story 9 + it 'does not display "Submit Application" button when no pets are on the application' do + visit "/applications/#{@application_2.id}" + + expect(page).to_not have_button("Submit Application") + end end From 709198fb1e11f02c7c162c62f501e1a97d967ad3 Mon Sep 17 00:00:00 2001 From: Carina Sweet Date: Sun, 18 Jul 2021 16:12:25 -0600 Subject: [PATCH 7/7] update user stories part 2 --- spec/features/applications/create_spec.rb | 5 +++-- spec/features/applications/update_spec.rb | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/features/applications/create_spec.rb b/spec/features/applications/create_spec.rb index 2ef292e91..d776e5aa2 100644 --- a/spec/features/applications/create_spec.rb +++ b/spec/features/applications/create_spec.rb @@ -9,6 +9,7 @@ end describe 'new application' do + #User story 4 it 'links to the new page from the pet index page' do visit '/pets' @@ -16,7 +17,7 @@ expect(current_path).to eq('/applications/new') end - + #User story 4 it 'can create a new application when all fields are filled out' do visit '/applications/new' @@ -40,7 +41,7 @@ expect(page).to have_content("Application Status: In Progress") end end - + #User story 5 describe 'not all fields are filled out' do it 're-renders the new form' do visit '/applications/new' diff --git a/spec/features/applications/update_spec.rb b/spec/features/applications/update_spec.rb index 1b95aa85f..01c9f7043 100644 --- a/spec/features/applications/update_spec.rb +++ b/spec/features/applications/update_spec.rb @@ -14,7 +14,7 @@ PetApplication.create!(pet: @pet_2, application: @application_1) PetApplication.create!(pet: @pet_3, application: @application_1) end - + #User story 7 it 'displays button next to searched pets' do visit "/applications/#{@application_1.id}" @@ -23,7 +23,7 @@ expect(page).to have_button("Adopt this Pet") end - + #User story 7 it 'add pet to pets list on the application when button selected' do visit "/applications/#{@application_1.id}" @@ -37,13 +37,13 @@ expect(current_path).to eq("/applications/#{@application_1.id}") find_link("#{@pet_4.name}") end - + #User story 8 it 'displays a "Submit Application" button when application has pets' do visit "/applications/#{@application_1.id}" expect(page).to have_button("Submit Application") end - + #User story 8 it 'updates application to "Pending" when the "Submit Application" is pushed' do visit "/applications/#{@application_1.id}"