Sha256: 15eab8394367d21e3ec1a9f25b735248b54d38546251f1a84045c0e2554639e1

Contents?: true

Size: 934 Bytes

Versions: 3

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe '.changes' do    
  it 'should fetch all changes' do
    stub = stub_get('/changes/', 'changes.json')                     
    
    client = MockGerry.new
    changes = client.changes
    
    expect(stub).to have_been_requested
    
    expect(changes[0]['project']).to eq('awesome')
    expect(changes[0]['branch']).to eq('master')
    
    expect(changes[1]['project']).to eq('clean')
    expect(changes[1]['subject']).to eq('Refactor code')
    expect(changes[1]['owner']['name']).to eq('Batman')
  end
  
  it 'should fetch all open changes' do
    
    stub = stub_get('/changes/?q=is:open+owner:self', 'open_changes.json')                     
    
    client = MockGerry.new
    changes = client.changes(['q=is:open+owner:self'])
    
    expect(stub).to have_been_requested
    
    expect(changes[0]['status']).to eq('OPEN')
    expect(changes[0]['owner']['name']).to eq('The Duke')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gerry-0.1.0 spec/changes_spec.rb
gerry-0.0.4 spec/changes_spec.rb
gerry-0.0.3 spec/changes_spec.rb