Sha256: 8fc93cbbecdd6237539d06b5a179885172ccc881513b6044a6c29a4cfa46ec34

Contents?: true

Size: 1.05 KB

Versions: 13

Compression:

Stored size: 1.05 KB

Contents

require_relative 'spec_helper'

describe MultipartForm::InProgressForm do
  describe "validations" do
    before(:each) do
      @ip_form = MultipartForm::InProgressForm.new
      @person = mock_model(Person)
      @person.stub!(:model).and_return("Person")
      @person.stub!(:id).and_return(1)

      form_name = :person_form.to_s

      @valid_attributes = {
        :form_subject => @person,
        :form_name => "hire_form",
        :last_completed_step => "personal_info",
        :completed => "false"
      }

    end

    it "should be valid" do
      @ip_form.attributes = @valid_attributes
      @ip_form.should be_valid
    end

    it "should require a form subject" do
      @ip_form.should have(1).error_on(:form_subject)
    end

    it "should require a form name" do
      @ip_form.should have(1).error_on(:form_name)
    end

    it "should require a last completed step" do
      @ip_form.should have(1).error_on(:last_completed_step)
    end

    it "should require completed" do
      @ip_form.should have(1).error_on(:completed)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
acts_as_multipart_form-0.0.13 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.12 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.11 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.10 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.9 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.8 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.7 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.6 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.5 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.4 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.3 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.2 spec/in_progress_form_spec.rb
acts_as_multipart_form-0.0.1 spec/in_progress_form_spec.rb