From 3402b6b06067f20ce4402dfa5803f13bf9c5a738 Mon Sep 17 00:00:00 2001 From: Philipp Rosenkranz Date: Mon, 15 Apr 2019 13:40:20 +0200 Subject: [PATCH] services: added services feature description & test implementation --- tests/feature_test.go | 2 +- tests/features/services.feature | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/features/services.feature diff --git a/tests/feature_test.go b/tests/feature_test.go index fdf314a..2fc06eb 100644 --- a/tests/feature_test.go +++ b/tests/feature_test.go @@ -139,7 +139,7 @@ func (c *cmdTest) shouldReturnTheFollowing(arg1 string, arg2 *gherkin.DocString) if err != nil { return err } - return assertEqual(arg2.Content, string(actualOutput)) + return assertEqual(strings.TrimSpace(arg2.Content), strings.TrimSpace(string(actualOutput))) } func assertEqual(expected, actual string) error { diff --git a/tests/features/services.feature b/tests/features/services.feature new file mode 100644 index 0000000..31408f3 --- /dev/null +++ b/tests/features/services.feature @@ -0,0 +1,31 @@ +Feature: projects + In order to use mite in a sane manner + As a mite user + I need to be able to list projects + + Scenario: list services + Given A local mock server is setup for the http method "GET" and path "/services.json" which returns: + """ + [ + { + "service": { + "id": 38672, + "name": "Website Konzeption", + "note": "", + "hourly_rate": 3300, + "archived": false, + "billable": true, + "created_at": "2009-12-13T12:12:00+01:00", + "updated_at": "2015-12-13T07:20:04+01:00" + } + } + ] + """ + And Mite is setup to connect to this mock server + Then "-c .mite.toml services" should return the following: + """ + id name notes + -- ---- ----- + 38672 Website Konzeption + + """