Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.4.14

- Fixed query params of Amazon Finances API v2024-06-19 [#98](https://github.com/patterninc/muffin_man/pull/98)
- [#99](https://github.com/patterninc/muffin_man/pull/99)

# 2.4.13

- Remove AWS STS Signature in requests [#97](https://github.com/patterninc/muffin_man/pull/97)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ As of now, this gem only supports portions of the following APIs with more to co
- `Uploads API v2020-11-01`
- `A+ API v2020-11-01`
- `Application Management API v2023-11-30`
- `Finances API v2024-06-19`

## Installation

Expand Down
2 changes: 1 addition & 1 deletion lib/muffin_man/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module MuffinMan
VERSION = "2.4.13"
VERSION = "2.4.14"
end
5 changes: 3 additions & 2 deletions spec/muffin_man/finances/v20240619_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
subject(:client) { described_class.new(credentials) }

let(:posted_after) { "2024-11-07T00:00:00Z" }
let(:posted_before) { "2024-11-08T00:00:00Z" }

before do
stub_request_access_token
end

describe "list_transactions" do
before do
stub_list_financial_transactions(posted_after: posted_after)
stub_list_financial_transactions(posted_after: posted_after, posted_before: posted_before)
end

it "lists transactions" do
response = client.list_transactions(posted_after: posted_after)
response = client.list_transactions(posted_after: posted_after, posted_before: posted_before)
expect(response.success?).to be true
expect(JSON.parse(response.body)["payload"]["transactions"]).to be_an(Array)
end
Expand Down
6 changes: 4 additions & 2 deletions spec/support/finances/stub_finances.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

def stub_list_financial_transactions(posted_after:)
stub_request(:get, "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}")
def stub_list_financial_transactions(posted_after:, posted_before: nil)
url = "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}"
url += "&postedBefore=#{posted_before}" if posted_before
stub_request(:get, url)
.to_return(status: 200, body: File.read("./spec/support/finances/list_transactions.json"), headers: {})
end