-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a17c93
commit ec2ae0a
Showing
6 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/terjira/client/jql_query_builer.rb → lib/terjira/client/jql_builder.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
require 'terjira/client/jql_builder' | ||
|
||
class TestJQLBuilder | ||
extend Terjira::Client::JQLBuilder | ||
end | ||
|
||
describe Terjira::Client::JQLBuilder do | ||
subject { TestJQLBuilder } | ||
|
||
it 'builds string value jql' do | ||
result = subject.build_jql(board: 1) | ||
expect(result).to be == 'board=1' | ||
|
||
result = subject.build_jql(issuetype: 'Task') | ||
expect(result).to be == 'issuetype=Task' | ||
end | ||
|
||
it 'builds array value jql' do | ||
result = subject.build_jql(sprint: [1, 2, 3]) | ||
expect(result).to be == 'sprint IN ("1","2","3")' | ||
|
||
result = subject.build_jql(priority: %w(high low)) | ||
expect(result).to be == 'priority IN ("high","low")' | ||
end | ||
|
||
it 'builds multiple key values jql' do | ||
result = subject.build_jql(sprint: 1, issuetype: %w(Task Done)) | ||
|
||
expect(result).to be == 'sprint=1 AND issuetype IN ("Task","Done")' | ||
end | ||
|
||
it 'filters unkown jql key' do | ||
result = subject.build_jql(unkown: 1) | ||
expect(result).to be == '' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters