Sha256: adf9cb00d0e9b5fea69575abfe6a4e7592e8f32727a9b0b51f8bddc02df2fcd1
Contents?: true
Size: 1.08 KB
Versions: 9
Compression:
Stored size: 1.08 KB
Contents
require File.dirname(__FILE__) + '/spec_helper.rb' describe Position do attr_reader :vote, :position before do @position = Position.new("W000779", "Yes") end describe "initializing" do it "assigns attributes as expected" do position.member_id.should == "W000779" position.vote_position.should == "Yes" end end describe "instance methods" do describe "#legislator" do it "returns the Legislator whose position this is" do mock(Legislator).find("W000779") do |legislator| stub(legislator).name {"Hank McPank"} end position.legislator.name.should == "Hank McPank" end end describe "#to_s" do it "returns the vote position" do position.to_s.should == "Yes" end end describe "#for?" do it "returns true when the vote_position is 'Yes'" do Position.new("W000779", 'Yes').should be_for end it "returns false when the vote_position is 'No'" do Position.new("W000779", 'No').should_not be_for end end end end
Version data entries
9 entries across 9 versions & 2 rubygems