require 'rails_helper'

RSpec.describe "services/edit", type: :view do
  before(:each) do
    @service = assign(:service, Service.create!(
      :short_title => "MyString",
      :long_title => "MyString",
      :image => "MyString",
      :order => 1,
      :text => "MyText"
    ))
  end

  it "renders the edit service form" do
    render

    assert_select "form[action=?][method=?]", service_path(@service), "post" do

      assert_select "input#service_short_title[name=?]", "service[short_title]"

      assert_select "input#service_long_title[name=?]", "service[long_title]"

      assert_select "input#service_image[name=?]", "service[image]"

      assert_select "input#service_order[name=?]", "service[order]"

      assert_select "textarea#service_text[name=?]", "service[text]"
    end
  end
end
