-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlist_test.rb
More file actions
36 lines (28 loc) · 1.01 KB
/
list_test.rb
File metadata and controls
36 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true
require_relative '../../../test_helper'
require 'linear/operations/project/list'
class ProjectListOperationTest < Minitest::Spec
describe 'Rubyists::Linear::Operations::Project::List' do
let(:projects) { [Object.new, Object.new] }
describe 'when mine is true' do
let(:params) { { mine: true } }
it 'fetches my projects' do
Rubyists::Linear::Project.stub :mine, projects do
result = Rubyists::Linear::Operations::Project::List.call(params: params)
_(result.success?).must_equal true
_(result[:projects]).must_equal projects
end
end
end
describe 'when mine is false' do
let(:params) { { mine: false } }
it 'fetches all projects' do
Rubyists::Linear::Project.stub :all, projects do
result = Rubyists::Linear::Operations::Project::List.call(params: params)
_(result.success?).must_equal true
_(result[:projects]).must_equal projects
end
end
end
end
end