-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: PPT-642 Add Place API support (#40)
- Loading branch information
Showing
6 changed files
with
519 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
# This configuration file was generated by `ameba --gen-config` | ||
# on 2020-03-10 06:52:09 UTC using Ameba version 0.10.1. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the reported problems are removed from the code base. | ||
|
||
# Problems found: 83 | ||
# Run `ameba --only Style/VariableNames` for details | ||
Style/VariableNames: | ||
Description: Enforces variable names to be in underscored case | ||
Enabled: true | ||
Lint/NotNil: | ||
Description: Identifies usage of `not_nil!` calls | ||
Enabled: false | ||
Severity: Warning | ||
|
||
Documentation/DocumentationAdmonition: | ||
Description: Reports documentation admonitions | ||
Enabled: false | ||
Severity: Warning | ||
|
||
Naming/AccessorMethodName: | ||
Description: Makes sure that accessor methods are named properly | ||
Enabled: false | ||
Severity: Convention | ||
|
||
Naming/QueryBoolMethods: | ||
Description: Reports boolean properties without the `?` suffix | ||
Enabled: false | ||
Severity: Convention | ||
|
||
Metrics/CyclomaticComplexity: | ||
Description: Disallows methods with a cyclomatic complexity higher than `MaxComplexity` | ||
Enabled: false | ||
Severity: Warning | ||
|
||
Naming/BlockParameterName: | ||
Description: Disallows non-descriptive block parameter names | ||
Enabled: false | ||
Severity: Convention | ||
|
||
Naming/PredicateName: | ||
Description: Disallows tautological predicate names | ||
Enabled: false | ||
Severity: Convention |
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,80 @@ | ||
require "../spec_helper" | ||
|
||
describe Office365::Places do | ||
describe "list_places" do | ||
it "list_places works for rooms" do | ||
SpecHelper.mock_client_auth | ||
SpecHelper.mock_list_room | ||
|
||
client = Office365::Client.new(**SpecHelper.mock_credentials) | ||
|
||
rooms = client.list_rooms | ||
|
||
rooms.value.size.should eq(2) | ||
rooms.value.first.is_a?(Office365::Room).should be_true | ||
|
||
list = client.list_places | ||
|
||
list.value.size.should eq(2) | ||
list.value.first.is_a?(Office365::Room).should be_true | ||
end | ||
|
||
it "list_places works for roomList" do | ||
SpecHelper.mock_client_auth | ||
SpecHelper.mock_list_room_list | ||
|
||
client = Office365::Client.new(**SpecHelper.mock_credentials) | ||
|
||
room_list = client.list_room_list | ||
|
||
room_list.value.size.should eq(2) | ||
room_list.value.first.is_a?(Office365::RoomList).should be_true | ||
|
||
list = client.list_places(type: Office365::PlaceType::RoomList) | ||
|
||
list.value.size.should eq(2) | ||
list.value.first.is_a?(Office365::RoomList).should be_true | ||
end | ||
end | ||
|
||
describe "#get_place" do | ||
it "get room when room id is provided" do | ||
SpecHelper.mock_client_auth | ||
SpecHelper.mock_get_room | ||
|
||
client = Office365::Client.new(**SpecHelper.mock_credentials) | ||
id = "979e9793-3e91-40eb-b18c-0ea937893956" | ||
|
||
room = client.get_room(id) | ||
room.is_a?(Office365::Room).should be_true | ||
room.id.should eq(id) | ||
end | ||
|
||
it "get RoomList when room list email provided" do | ||
SpecHelper.mock_client_auth | ||
SpecHelper.mock_get_room_list | ||
|
||
client = Office365::Client.new(**SpecHelper.mock_credentials) | ||
email = "Building2Rooms@contoso.com" | ||
|
||
room = client.get_room_list(email) | ||
room.is_a?(Office365::RoomList).should be_true | ||
room.email_address.should eq(email) | ||
end | ||
end | ||
|
||
describe "#list_room_in_room_list" do | ||
it "list rooms in room list" do | ||
SpecHelper.mock_client_auth | ||
SpecHelper.mock_get_room_in_room_list | ||
|
||
client = Office365::Client.new(**SpecHelper.mock_credentials) | ||
email = "Building2Rooms@contoso.com" | ||
|
||
rooms = client.list_rooms_in_room_list(email) | ||
rooms.is_a?(Office365::RoomLists).should be_true | ||
rooms.value.size.should eq(3) | ||
rooms.value.first.is_a?(Office365::RoomList).should be_true | ||
end | ||
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
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
Oops, something went wrong.