Skip to content

Commit

Permalink
Update tests, factories and snapshots to include new project attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
yulia-bel committed Nov 21, 2023
1 parent 821ef80 commit 47ca636
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 25 deletions.
2 changes: 1 addition & 1 deletion backend/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ GEM
railties (>= 5.0)
retriable (3.1.2)
rexml (3.2.5)
rgeo (2.4.0)
rgeo (3.0.1)
rgeo-activerecord (7.0.1)
activerecord (>= 5.0)
rgeo (>= 1.0.0)
Expand Down
12 changes: 11 additions & 1 deletion backend/db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/spec/factories/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

climate_change_risks_identified { true }

sequence(:limate_change_risks_details) do |n|
sequence(:climate_change_risks_details) do |n|
Faker::Config.random = Random.new(n)
Faker::Lorem.paragraph(sentence_count: 2)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": false,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": true,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
18 changes: 15 additions & 3 deletions backend/spec/fixtures/snapshots/api/v1/account/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": false,
"funded": null
"funded": null,
"positive_financial_returns": "Dolores fugiat nesciunt. Ut laborum dolores.",
"last_year_sales_revenue": "Dolores fugiat nesciunt.",
"climate_change_risks_details": "Dolores fugiat nesciunt. Ut laborum dolores.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -254,7 +258,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": false,
"funded": null
"funded": null,
"positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.",
"last_year_sales_revenue": "Placeat commodi libero.",
"climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -402,7 +410,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": false,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@
"project_climate_impact": null,
"project_water_impact": null,
"project_community_impact": null,
"project_total_impact": null
"project_total_impact": null,
"positive_financial_returns": null,
"last_year_sales_revenue": null,
"climate_change_risks_details": null,
"climate_change_risks_identified": false
},
"relationships": {
"project_developer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@
"project_climate_impact": null,
"project_water_impact": null,
"project_community_impact": null,
"project_total_impact": null
"project_total_impact": null,
"positive_financial_returns": "Updated financial returns data",
"last_year_sales_revenue": "Updated year sales revenues",
"climate_change_risks_details": "Updated climate risk details",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -278,7 +282,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.",
"last_year_sales_revenue": "Placeat commodi libero.",
"climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
6 changes: 5 additions & 1 deletion backend/spec/fixtures/snapshots/api/v1/get-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@
"project_climate_impact": null,
"project_water_impact": null,
"project_community_impact": null,
"project_total_impact": null
"project_total_impact": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -406,7 +410,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.",
"last_year_sales_revenue": "Placeat commodi libero.",
"climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
48 changes: 40 additions & 8 deletions backend/spec/fixtures/snapshots/api/v1/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Placeat commodi libero. Quo recusandae repellat.",
"last_year_sales_revenue": "Placeat commodi libero.",
"climate_change_risks_details": "Placeat commodi libero. Quo recusandae repellat.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -254,7 +258,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Et quaerat omnis. Harum voluptas atque.",
"last_year_sales_revenue": "Et quaerat omnis.",
"climate_change_risks_details": "Et quaerat omnis. Harum voluptas atque.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -402,7 +410,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Dolores fugiat nesciunt. Ut laborum dolores.",
"last_year_sales_revenue": "Dolores fugiat nesciunt.",
"climate_change_risks_details": "Dolores fugiat nesciunt. Ut laborum dolores.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -550,7 +562,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Autem et et. Voluptatem neque quibusdam.",
"last_year_sales_revenue": "Autem et et.",
"climate_change_risks_details": "Autem et et. Voluptatem neque quibusdam.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -698,7 +714,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Porro soluta beatae. Quia ratione facilis.",
"last_year_sales_revenue": "Porro soluta beatae.",
"climate_change_risks_details": "Porro soluta beatae. Quia ratione facilis.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -846,7 +866,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Mollitia aut vel. Qui illum accusantium.",
"last_year_sales_revenue": "Mollitia aut vel.",
"climate_change_risks_details": "Mollitia aut vel. Qui illum accusantium.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -994,7 +1018,11 @@
"latitude": 39.21309022641362,
"longitude": -5.87810037515931,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Tempora excepturi et. Et quia sit.",
"last_year_sales_revenue": "Tempora excepturi et.",
"climate_change_risks_details": "Tempora excepturi et. Et quia sit.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down Expand Up @@ -1134,7 +1162,11 @@
"latitude": 0.5,
"longitude": 0.5,
"favourite": null,
"funded": null
"funded": null,
"positive_financial_returns": "Enim repellat pariatur. Earum modi eos.",
"last_year_sales_revenue": "Enim repellat pariatur.",
"climate_change_risks_details": "Enim repellat pariatur. Earum modi eos.",
"climate_change_risks_identified": true
},
"relationships": {
"project_developer": {
Expand Down
10 changes: 9 additions & 1 deletion backend/spec/requests/api/v1/accounts/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
received_funding: {type: :boolean},
received_funding_amount_usd: {type: :number},
received_funding_investor: {type: :string},
positive_financial_returns: {type: :string},
last_year_sales_revenue: {type: :string},
climate_change_risks_details: {type: :string},
climate_change_risks_identified: {type: :boolean},
replicability: {type: :string},
sustainability: {type: :string},
progress_impact_tracking: {type: :string},
Expand Down Expand Up @@ -297,7 +301,11 @@
impact_areas: %w[restoration pollutants-reduction],
sdgs: [2, 4, 5],
instrument_types: %w[grant],
locale: :en
locale: :en,
positive_financial_returns: "Updated financial returns data",
last_year_sales_revenue: "Updated year sales revenues",
climate_change_risks_details: "Updated climate risk details",
climate_change_risks_identified: true
}
end

Expand Down
2 changes: 1 addition & 1 deletion backend/spec/system/backoffice/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
fill_in t("simple_form.labels.project.positive_financial_returns"), with: "Positive financial returns"
fill_in t("simple_form.labels.project.last_year_sales_revenue"), with: "Last year sales revenue"
choose "Yes", name: "project[climate_change_risks_identified]"
fill_in t("simple_form.labels.climate_change_risks_details"), with: "Climate change risks identified"
fill_in t("simple_form.labels.project.climate_change_risks_details"), with: "Climate change risks identified"
fill_in t("simple_form.labels.project.replicability"), with: "New replicability"
fill_in t("simple_form.labels.project.sustainability"), with: "New sustainability"
fill_in t("simple_form.labels.project.progress_impact_tracking"), with: "New progress impact tracking"
Expand Down

0 comments on commit 47ca636

Please sign in to comment.