Sha256: 837aa7ebcbf7093516255336b510bd22696e27367b47118ab33421ba16190282

Contents?: true

Size: 769 Bytes

Versions: 3

Compression:

Stored size: 769 Bytes

Contents

require 'spec_helper'

describe Cucumber::Factory do

  subject { Cucumber::Factory }

  describe 'model_class_from_prose' do

    it "should return the class matching a natural language expression" do
      subject.send(:model_class_from_prose, "movie").should == Movie
      subject.send(:model_class_from_prose, "job offer").should == JobOffer
    end

    it "should allow namespaced models" do
      subject.send(:model_class_from_prose, "people/actor").should == People::Actor
    end

  end

  describe 'factory_girl_factory_name' do

    it "should underscorize everything" do
      subject.send(:factory_girl_factory_name, People::Actor).should == :people_actor
      subject.send(:factory_girl_factory_name, JobOffer).should == :job_offer
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber_factory-1.9.2 spec/shared/cucumber_factory/factory_spec.rb
cucumber_factory-1.9.1 spec/shared/cucumber_factory/factory_spec.rb
cucumber_factory-1.8.6 spec/factory_spec.rb