Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe Timesheet::TogglRecord do
- let!(:config) { fixture('config', :yaml) }
- let!(:toggl_record) { fixture('toggl_response')[:data].first }
- let (:record) { Timesheet::TogglRecord.new toggl_record, config }
- context '#issue_id' do
- it 'don\'t work if no redmine time entry class in config' do
- record = Timesheet::TogglRecord.new({ description: 'hello' }, {})
- params = { comment: '#1382 Alonsee!' }
- expect(record.issue_id params).to be_nil
- end
- context 'with redmine time entry class in config' do
- it 'return nil if no #<issue_id> in comment' do
- params = { comment: '1382 Alonsee!' }
- expect(record.issue_id params).to be_nil
- end
- it 'return id if it is given' do
- params = { comment: '#1382 Alonsee!' }
- expect(record.issue_id params).to eq 1382
- end
- it 'allows space between # and number' do
- params = { comment: '# 1382 Alonsee!' }
- expect(record.issue_id params).to eq 1382
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement