Skip to content

Instantly share code, notes, and snippets.

@alanmclean
Created October 30, 2013 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanmclean/7236992 to your computer and use it in GitHub Desktop.
Save alanmclean/7236992 to your computer and use it in GitHub Desktop.
context '#get_weeks' do
context 'months in 2013' do
let(:months){
{ :year => 2013, :month => 10, :month_interval => "2013y10m", :intervals => ["2013y41w","2013y42w","2013y43w","2013y44w"] }
}
let(:weeks){ helper.get_weeks(months) }
it 'should return assoc array of weeks intervals to month, year data' do
weeks.should == [
{ "2013y41w" => { :year => 2013, :month => 10, :month_interval => "2013y10m" }},
{ "2013y42w" => { :year => 2013, :month => 10, :month_interval => "2013y10m" }},
{ "2013y43w" => { :year => 2013, :month => 10, :month_interval => "2013y10m" }},
{ "2013y44w" => { :year => 2013, :month => 10, :month_interval => "2013y10m" }}
]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment