Skip to content

Instantly share code, notes, and snippets.

@priyapower
Last active August 20, 2020 04:16
Show Gist options
  • Save priyapower/b02d353b8e4ec4ab9046b58f373e7a94 to your computer and use it in GitHub Desktop.
Save priyapower/b02d353b8e4ec4ab9046b58f373e7a94 to your computer and use it in GitHub Desktop.
require 'rails_helper'

 RSpec.describe "shelters index page", type: :feature do
   shelter_1 = Shelter.create(name: "The Humane Society - Denver")
   shelter_2 = Shelter.create(name: "Denver Animal Shelter")

   it "can see all shelter names" do
     visit "/shelters"

     expect(page).to have_content(shelter_1.name)
     expect(page).to have_content(shelter_2.name)
   end
 end


 RSpec.describe Shelter, type: :model do
   # before :each do
     # @shelter_1 = Shelter.create(name: "The Humane Society - Denver", address: "1 Place St", city: "Denver", state: "CO", zip: 11111)
     # @shelter_2 = Shelter.create(name: "Denver Animal Shelter", address: "2 There Blvd", city: "Denver", state: "CO", zip: 22222)
   # end

   it "is valid with valid attributes" do
     expect(Shelter.new).to be_valid
   end

   # it "is not valid without a name" do
   #   expect(@shelter_1).to_not be_valid
   # end

   it "is not valid without a address"
   it "is not valid without a city"
   it "is not valid without a state"
   it "is not valid without a zip"
 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment