Sha256: 38b7243756ae328db231830eeea71c93ba571ce49c3ba826c2336796d79e37bf

Contents?: true

Size: 1.5 KB

Versions: 21

Compression:

Stored size: 1.5 KB

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')

describe Project do 
  before do 
    @hash_vals = File.read(File.join(File.dirname(__FILE__), 'fixtures', 'project.txt'))
    RallyAPI.stub(:get).and_return(eval(@hash_vals))
  end

  describe "#associate" do 
    before do 
      @project = Project.new(:rally_uri => "http://testuri.com")
    end

    it "should associate project" do 
      @project.associate(eval(@hash_vals))
      @project.parent.should_not be_nil
    end
  end


  describe "looking up attrs from Rally for invalid project" do 
   before do 
     Project.collection.remove
     @project = Project.new
   end

   it "should raise error" do 
     lambda{@project.refresh}.should raise_error
   end
 end

  describe "looking up attrs from Rally for valid project" do 
    before do 
      Project.collection.remove
      @name = "Down the hatch"
      @project = Project.new(:rally_uri => "http://demouri.com")
    end

    it "should accept a hash of values" do 
      RallyAPI.should_not_receive(:get)
      @project.refresh eval(@hash_vals)
    end

    it "should pull name" do 
      @project.refresh
      @project.name.should == @name
    end
    
    it "should set description" do 
      @project.refresh
      @project.description.should == "A nice description"
    end

    it "should set the notes" do 
      @project.refresh
      @project.notes.should == "some notes"
    end

    it "should set the state" do 
      @project.refresh
      @project.state.should == "Open"
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rallytastic-1.4.9 spec/project_spec.rb
rallytastic-1.4.8 spec/project_spec.rb
rallytastic-1.4.7 spec/project_spec.rb
rallytastic-1.4.6 spec/project_spec.rb
rallytastic-1.4.5 spec/project_spec.rb
rallytastic-1.4.4 spec/project_spec.rb
rallytastic-1.4.0 spec/project_spec.rb
rallytastic-1.3.0 spec/project_spec.rb
rallytastic-1.2.8 spec/project_spec.rb
rallytastic-1.2.7 spec/project_spec.rb
rallytastic-1.2.6 spec/project_spec.rb
rallytastic-1.2.5 spec/project_spec.rb
rallytastic-1.2.4 spec/project_spec.rb
rallytastic-1.2.3 spec/project_spec.rb
rallytastic-1.2.2 spec/project_spec.rb
rallytastic-1.2.1 spec/project_spec.rb
rallytastic-1.2.0 spec/project_spec.rb
rallytastic-1.1.2 spec/project_spec.rb
rallytastic-1.1.1 spec/project_spec.rb
rallytastic-1.1.0 spec/project_spec.rb