require 'spec_helper' describe "Provider Locations" do before(:each) do @provider_location = FactoryGirl.create(:provider_location) end it "is valid with valid attributes" do @provider_location.should be_valid end describe "Required attributes" do required_fields = %w[name address city state zip] required_fields.each do |field| it "requires #{field} attribute" do provider_location = @provider_location #provider_location.send(field << '=', "") provider_location.send("#{field}=", "") provider_location.should_not be_valid end end end end