require 'rails_helper'

RSpec.describe "services/edit", type: :view do
  before(:each) do
    @service = assign(:service, Service.create!(
      :name => "MyString",
      :status => 1,
      :environment => nil
    ))
  end

  it "renders the edit service form" do
    render

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

      assert_select "input[name=?]", "service[name]"

      assert_select "input[name=?]", "service[status]"

      assert_select "input[name=?]", "service[environment_id]"
    end
  end
end
