altered the spec but still not working test

pull/916/head
Jonas Heinrich 11 years ago
parent 69049af80a
commit 79f33e0aa6
  1. 18
      spec/models/query_spec.rb

@ -73,18 +73,24 @@ describe Query do
end
context 'with a missing value for a custom field' do
let(:custom_field) {FactoryGirl.create :issue_custom_field}
let(:query2) { FactoryGirl.build(:query)}
let(:project) { FactoryGirl.create(:project_with_types) }
let(:type) {FactoryGirl.create(:type) }
let(:custom_field) do
FactoryGirl.create :issue_custom_field,
:name => "Verse",
:field_format => "text",
:projects => [project],
:types => [type]
end
let(:query) { FactoryGirl.build(:query)}
before do
query.add_filter("cf_" + custom_field.id.to_s,"=",[""])
end
it 'should have the name of the custom field in the error message' do
require 'pry'
binding.pry
expect(query2.valid?).to be_false
expect(query2.errors.messages[:base].to_s).to include(custom_field.name)
expect(query.valid?).to be_false
expect(query.errors.messages[:base].to_s).to include(custom_field.name)
end
end
end

Loading…
Cancel
Save