Skip to content

Commit

Permalink
Add Team#total_team_members and update donate URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppostma committed Aug 13, 2024
1 parent 8bbd362 commit 950bcda
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 18 deletions.
4 changes: 4 additions & 0 deletions lib/kentaa/api/resources/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def description
data[:description]
end

def total_team_members
data[:total_team_members]
end

def target_amount
data[:target_amount]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/responses/action.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"ended": false,
"previous_participations": 1,
"url": "https://demo1.kentaa.nl/actie/john-doe",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/doneren",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/donate",
"registration_fee": {
"amount": "25.0",
"title": "Sign up fee"
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/responses/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"ended": false,
"previous_participations": 1,
"url": "https://demo1.kentaa.nl/actie/john-doe",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/doneren",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/donate",
"photos": [
{
"id": 2,
Expand Down Expand Up @@ -73,7 +73,7 @@
"total_donations": 2,
"visible": true,
"url": "https://demo1.kentaa.nl/actie/john-doe-2",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe-2/doneren",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe-2/donate",
"photos": [
{
"id": 2,
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/responses/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ended": true,
"end_date": "2015-10-28T00:00:00Z",
"url": "https://demo1.kentaa.nl/project/dignissimos-provident",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident/doneren",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident/donate",
"contact": {
"first_name": "John",
"last_name": "Doe",
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/responses/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ended": true,
"end_date": "2015-10-28T00:00:00Z",
"url": "https://demo1.kentaa.nl/project/dignissimos-provident",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident/doneren",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident/donate",
"contact": {
"first_name": "John",
"last_name": "Doe",
Expand Down Expand Up @@ -57,7 +57,7 @@
"ended": true,
"end_date": "2015-10-28T00:00:00Z",
"url": "https://demo1.kentaa.nl/project/dignissimos-provident-2",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident-2/doneren",
"donate_url": "https://demo1.kentaa.nl/project/dignissimos-provident-2/donate",
"contact": {
"first_name": "John",
"last_name": "Doe",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/responses/segment.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"total_amount": "0.0",
"total_donations": 0,
"url": "https://segment-2.demo1.kentaa.nl/",
"donate_url": "https://segment-2.demo1.kentaa.nl/doneren",
"donate_url": "https://segment-2.demo1.kentaa.nl/donate",
"banners": [
{
"id": 14,
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/responses/segments.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"total_amount": "0.0",
"total_donations": 0,
"url": "https://segment-2.demo1.kentaa.nl/",
"donate_url": "https://segment-2.demo1.kentaa.nl/doneren",
"donate_url": "https://segment-2.demo1.kentaa.nl/donate",
"banners": [
{
"id": 14,
Expand Down
7 changes: 4 additions & 3 deletions spec/fixtures/responses/team.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"last_name": "Klein",
"email": "[email protected]",
"url": "https://demo1.kentaa.nl/actie/thomas-klein",
"donate_url": "https://demo1.kentaa.nl/actie/thomas-klein/doneren"
"donate_url": "https://demo1.kentaa.nl/actie/thomas-klein/donate"
},
{
"id": 3,
Expand All @@ -43,12 +43,13 @@
"last_name": "Doe",
"email": "[email protected]",
"url": "https://demo1.kentaa.nl/actie/john-doe",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/doneren"
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/donate"
}
],
"name": "Asperiores beatae voluptate qui.",
"title": "Vero aspernatur dolores et excepturi.",
"description": "Cum odio est. Consequuntur occaecati sapiente molestiae quam recusandae possimus aut. Ratione cum harum beatae ad repellat minus.",
"total_team_members": 2,
"target_amount": 2000,
"total_amount": "225.0",
"total_donations": 4,
Expand All @@ -58,6 +59,6 @@
"closed": false,
"ended": false,
"url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui",
"donate_url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/doneren"
"donate_url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/donate"
}
}
7 changes: 4 additions & 3 deletions spec/fixtures/responses/teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"last_name": "Klein",
"email": "[email protected]",
"url": "https://demo1.kentaa.nl/actie/thomas-klein",
"donate_url": "https://demo1.kentaa.nl/actie/thomas-klein/doneren"
"donate_url": "https://demo1.kentaa.nl/actie/thomas-klein/donate"
},
{
"id": 3,
Expand All @@ -42,12 +42,13 @@
"last_name": "Doe",
"email": "[email protected]",
"url": "https://demo1.kentaa.nl/actie/john-doe",
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/doneren"
"donate_url": "https://demo1.kentaa.nl/actie/john-doe/donate"
}
],
"name": "Asperiores beatae voluptate qui.",
"title": "Vero aspernatur dolores et excepturi.",
"description": "Cum odio est. Consequuntur occaecati sapiente molestiae quam recusandae possimus aut. Ratione cum harum beatae ad repellat minus.",
"total_team_members": 2,
"target_amount": 2000,
"total_amount": "225.0",
"total_donations": 4,
Expand All @@ -57,7 +58,7 @@
"closed": false,
"ended": false,
"url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui",
"donate_url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/doneren"
"donate_url": "https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/donate"
}
],
"links": {
Expand Down
2 changes: 1 addition & 1 deletion spec/kentaa/api/resources/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@

describe '#donate_url' do
it 'returns the donate URL' do
expect(response.donate_url).to eq('https://demo1.kentaa.nl/actie/john-doe/doneren')
expect(response.donate_url).to eq('https://demo1.kentaa.nl/actie/john-doe/donate')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/kentaa/api/resources/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

describe '#donate_url' do
it 'returns the donate URL' do
expect(response.donate_url).to eq('https://demo1.kentaa.nl/project/dignissimos-provident/doneren')
expect(response.donate_url).to eq('https://demo1.kentaa.nl/project/dignissimos-provident/donate')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/kentaa/api/resources/segment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

describe '#donate_url' do
it 'returns the donate URL' do
expect(response.donate_url).to eq('https://segment-2.demo1.kentaa.nl/doneren')
expect(response.donate_url).to eq('https://segment-2.demo1.kentaa.nl/donate')
end
end

Expand Down
8 changes: 7 additions & 1 deletion spec/kentaa/api/resources/team_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
end
end

describe '#total_team_members' do
it 'returns the total number of team members' do
expect(response.total_team_members).to eq(2)
end
end

describe '#target_amount' do
it 'returns the target amount' do
expect(response.target_amount).to eq(2000)
Expand Down Expand Up @@ -164,7 +170,7 @@

describe '#donate_url' do
it 'returns the donate URL' do
expect(response.donate_url).to eq('https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/doneren')
expect(response.donate_url).to eq('https://demo1.kentaa.nl/team/asperiores-beatae-voluptate-qui/donate')
end
end

Expand Down

0 comments on commit 950bcda

Please sign in to comment.