aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_batch_spec.rb
blob: f6d9bea0cb4917ec8553dd6d5bb06ba784e314c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe InfoRequestBatch, "when validating" do

    before do
        @info_request_batch = FactoryGirl.build(:info_request_batch)
    end

    it 'should require a user' do
        @info_request_batch.user = nil
        @info_request_batch.valid?.should be_false
        @info_request_batch.errors.full_messages.should == ["User can't be blank"]
    end

    it 'should require a title' do
        @info_request_batch.title = nil
        @info_request_batch.valid?.should be_false
        @info_request_batch.errors.full_messages.should == ["Title can't be blank"]
    end

end