All pastes #886272 Raw Edit

Stuff

public ruby v1 · immutable
#886272 ·published 2008-01-31 15:51 UTC
rendered paste body
  it "should set the start_date for subsequent periods" do    @organization = Organization.create    @person = Person.create    @organization.add_member(@person)    @organization.remove_member(@person)    @organization.add_member(@person)    # there should be 2 periods, one with an end date, one with a start date    # neither will have both values set.    reloaded = Organization.find(@organization.id)    membership = @organization.memberships[0]    periods = membership.periods    # first == most recent    periods[0].start_date.should_not be_nil    periods[0].end_date.should be_nil    periods[1].start_date.should be_nil    periods[1].end_date.should_not be_nil  end