spec/helpers_spec.rb in overview-0.0.6.pre.24 vs spec/helpers_spec.rb in overview-0.0.7.pre.26

- old
+ new

@@ -261,37 +261,96 @@ RSpec.describe 'Sprintly#retrieveSprintlyItem' do it 'returns hackpad item' do cache = Cache.new sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) - item = sprintly.sprintlyItem(1) - + item = sprintly.sprintly_item(1) expect(item.hackpads.count).to eq(1) end end RSpec.describe 'Sprintly#retrieveSprintlyItem' do it 'returns sprintly item with id' do cache = Cache.new sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) - item = sprintly.sprintlyItem(1) - item = sprintly.sprintlyItem(1) - + item = sprintly.sprintly_item(1) expect(item.id).to eq(1) end end -RSpec.describe 'Sprintly#retrieveSprintlyItem' do - it 'returns hackpad item' do +RSpec.describe 'Sprintly#retrieveSprintlyItem.allHackpads' do + it 'returns single hackpad item' do cache = Cache.new sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) - item = sprintly.sprintlyItem(1) + item = sprintly.sprintly_item(2) + expect(item.hackpads.count).to eq(0) + expect(item.all_hackpads.count).to eq(1) + end +end +RSpec.describe 'Sprintly#retrieveSprintlyItem.allHackpads' do + it 'returns multiple hackpad items' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(4) expect(item.hackpads.count).to eq(1) + expect(item.all_hackpads.count).to eq(2) end end +RSpec.describe 'Sprintly#retrieveSprintlyItem.inspect' do + it 'returns beautiful description' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(4) + expect(item.inspect).to eq("<http://sprint.ly/i/30420/4/|#4 - This has a hackpad link>") + end +end + +RSpec.describe 'Sprintly#retrieveSprintlyItem.all_items' do + it 'returns single item' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(1) + expect(item.all_items.count).to eq(1) + end +end + +RSpec.describe 'Sprintly#retrieveSprintlyItem.all_items' do + it 'returns mutliple items' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(4) + expect(item.all_items.count).to eq(2) + end +end + +RSpec.describe 'Sprintly#retrieveSprintlyItem.isStory?' do + it 'returns story' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(1) + expect(item.is_story?).to eq(true) + end +end + +RSpec.describe 'Sprintly#retrieveSprintlyItem.isStory?' do + it 'returns subtask' do + cache = Cache.new + sprintly = Sprintly.new(30420,"jono+overview+test@overllc.com", "kPnNLnM8pjkYeS9sMvrQPhj6JkC4mcNL", cache) + item = sprintly.sprintly_item(2) + expect(item.is_story?).to eq(false) + end +end + +RSpec.describe 'SprintlyEmbeddedURL#new' do + it 'returns SprintlyEmbeddedURL' do + url = SprintlyEmbeddedURL.new("https://hackpad.com/Hackpad-FAQ-tq56fI63mz3") + expect(url.to_s).to eq("<https://hackpad.com/Hackpad-FAQ-tq56fI63mz3|https://hackpad.com/Hackpad-FAQ-tq56fI63mz3>") + end +end +SprintlyEmbeddedURL