require 'rails_helper'

RSpec.describe "property_types/edit", :type => :view do
  before(:each) do
    @property_type = assign(:property_type, PropertyType.create!(
      :name => "MyString",
      :description => "MyString",
      :allowed_values => ["MyString"],
      :restrict_to_allowed_values => false
    ))
  end

  it "renders the edit property_type form" do
    render

    assert_select "form[action=?][method=?]", property_type_path(@property_type), "post" do

      assert_select "input#property_type_name[name=?]", "property_type[name]"

      assert_select "textarea#property_type_description[name=?]", "property_type[description]"

      assert_select "textarea#property_type_allowed_values_s[name=?]", "property_type[allowed_values_s]"

      assert_select "input#property_type_restrict_to_allowed_values[name=?]", "property_type[restrict_to_allowed_values]"
    end
  end
end
