File: worklog_spec.rb

package info (click to toggle)
ruby-jira 2.1.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 968 kB
  • sloc: ruby: 5,125; makefile: 12
file content (22 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe JIRA::Resource::Worklog do
  let(:client) { double }

  describe 'relationships' do
    subject do
      JIRA::Resource::Worklog.new(client, issue_id: '99999', attrs: {
                                    'author' => { 'foo' => 'bar' },
                                    'updateAuthor' => { 'foo' => 'bar' }
                                  })
    end

    it 'has the correct relationships' do
      expect(subject).to have_one(:author, JIRA::Resource::User)
      expect(subject.author.foo).to eq('bar')

      expect(subject).to have_one(:update_author, JIRA::Resource::User)
      expect(subject.update_author.foo).to eq('bar')
    end
  end
end