Skip to content

Commit

Permalink
Merge branch 'main' into 18-feature-request-featured_tags-api-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
myConsciousness committed Dec 26, 2022
2 parents 4bc8dae + c874e88 commit 1f2eaa5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
"profile": "https://github.com/Elleo",
"contributions": [
"ideas",
"content"
"content",
"code",
"bug",
"test"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center"><a href="https://github.com/myConsciousness"><img src="https://avatars.githubusercontent.com/u/13072231?v=4?s=100" width="100px;" alt="KATO, Shinya / 加藤 真也"/><br /><sub><b>KATO, Shinya / 加藤 真也</b></sub></a><br /><a href="https://github.com/mastodon-dart/mastodon-api/commits?author=myConsciousness" title="Code">💻</a> <a href="https://github.com/mastodon-dart/mastodon-api/commits?author=myConsciousness" title="Documentation">📖</a> <a href="#design-myConsciousness" title="Design">🎨</a> <a href="#example-myConsciousness" title="Examples">💡</a> <a href="#fundingFinding-myConsciousness" title="Funding Finding">🔍</a> <a href="#ideas-myConsciousness" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-myConsciousness" title="Maintenance">🚧</a> <a href="#security-myConsciousness" title="Security">🛡️</a> <a href="https://github.com/mastodon-dart/mastodon-api/commits?author=myConsciousness" title="Tests">⚠️</a> <a href="#tutorial-myConsciousness" title="Tutorials">✅</a></td>
<td align="center"><a href="https://github.com/MarkOSullivan94"><img src="https://avatars.githubusercontent.com/u/6950843?v=4?s=100" width="100px;" alt="Mark O'Sullivan"/><br /><sub><b>Mark O'Sullivan</b></sub></a><br /><a href="https://github.com/mastodon-dart/mastodon-api/commits?author=MarkOSullivan94" title="Documentation">📖</a> <a href="#ideas-MarkOSullivan94" title="Ideas, Planning, & Feedback">🤔</a> <a href="#question-MarkOSullivan94" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/Elleo"><img src="https://avatars.githubusercontent.com/u/59350?v=4?s=100" width="100px;" alt="Mike Sheldon"/><br /><sub><b>Mike Sheldon</b></sub></a><br /><a href="#ideas-Elleo" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-Elleo" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/Elleo"><img src="https://avatars.githubusercontent.com/u/59350?v=4?s=100" width="100px;" alt="Mike Sheldon"/><br /><sub><b>Mike Sheldon</b></sub></a><br /><a href="#ideas-Elleo" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-Elleo" title="Content">🖋</a> <a href="https://github.com/mastodon-dart/mastodon-api/commits?author=Elleo" title="Code">💻</a> <a href="https://github.com/mastodon-dart/mastodon-api/issues?q=author%3AElleo" title="Bug reports">🐛</a> <a href="https://github.com/mastodon-dart/mastodon-api/commits?author=Elleo" title="Tests">⚠️</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion lib/src/service/v1/apps/apps_v1_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class _AppsV1Service extends BaseService implements AppsV1Service {
body: {
'client_name': clientName,
'redirect_uris': redirectUri,
'scopes': scopes?.map((e) => e.value).toList(),
'scopes': scopes?.map((e) => e.value).join(" "),
'website': websiteUrl,
},
checkEntity: true,
Expand Down
23 changes: 23 additions & 0 deletions test/src/service/v1/apps/apps_v1_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@ void main() {
expect(response.data, isA<RegisteredApplication>());
});

test('multiple scopes', () async {
final appsService = AppsV1Service(
instance: 'test',
context: context.buildPostStub(
'test',
UserContext.anonymousOnly,
'/api/v1/apps',
'test/src/service/v1/apps/data/create_application.json',
),
);

final response = await appsService.createApplication(
clientName: 'test',
redirectUri: 'https://test//:oauth',
scopes: [Scope.read, Scope.write, Scope.push],
websiteUrl: 'https://shinyakato.dev',
);

expect(response, isA<MastodonResponse>());
expect(response.rateLimit, isA<RateLimit>());
expect(response.data, isA<RegisteredApplication>());
});

test('when unauthorized', () async {
final appsService = AppsV1Service(
instance: 'test',
Expand Down

0 comments on commit 1f2eaa5

Please sign in to comment.