Restaurantly#edit, #update integration tests
John Davison photo
Get notifications about new tutorials, code and events.

click: follow along with the source code

INTEGRATION RESTAURANTS#EDIT

git checkout -b restaurant-edit-integration

modify spec/features/restaurants_spec.rb

  describe "edit links work" do
    context "displays ", :driver => :selenium do
      it "Restaurantly Spots!" do
        visit '/restaurants/new'
        fill_in 'restaurant_name', with: "mc ruby"
        click_button 'submit!'
        visit '/'
        click_link 'edit'
        fill_in 'restaurant_name', with: "mc rails"
        click_button 'update'
        expect(page).to have_content 'mc rails'
      end
    end
  end

rspec spect/features/restaurant_spec.rb

  describe "destroy links work" do
    context "displays ", :driver => :selenium do
      it "Restaurantly Spots!" do
        visit '/restaurants/new'
        fill_in 'restaurant_name', with: "mc ruby"
        click_button 'submit!'
        expect(page).to have_content 'mc ruby'
        visit '/'
        click_link 'destroy'
        expect(page).to have_no_content 'mc ruby'
      end
    end
  end

rspec spec/features/restaurant_spec.rb

Get notifications about new tutorials, code and events.