Add and apply LineContinuationSpacing rubocop rule
So now we're consistent when separating multiline strings.
This commit is contained in:
@@ -95,6 +95,9 @@ Layout/IndentationWidth:
|
|||||||
Layout/LeadingEmptyLines:
|
Layout/LeadingEmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/LineContinuationSpacing:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/LineEndStringConcatenationIndentation:
|
Layout/LineEndStringConcatenationIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
section "Creating Geozones" do
|
section "Creating Geozones" do
|
||||||
Geozone.create!(name: I18n.t("seeds.geozones.north_district"),
|
Geozone.create!(name: I18n.t("seeds.geozones.north_district"),
|
||||||
external_code: "001", census_code: "01",
|
external_code: "001", census_code: "01",
|
||||||
html_map_coordinates: "30,139,45,153,77,148,107,165,138,201,146,218,186,198,216,"\
|
html_map_coordinates: "30,139,45,153,77,148,107,165,138,201,146,218,186,198,216," \
|
||||||
"196,233,203,240,215,283,194,329,185,377,184,388,165,369,126,333,113,334,84,320,"\
|
"196,233,203,240,215,283,194,329,185,377,184,388,165,369,126,333,113,334,84,320," \
|
||||||
"66,286,73,258,65,265,57,249,47,207,58,159,84,108,85,72,101,51,114")
|
"66,286,73,258,65,265,57,249,47,207,58,159,84,108,85,72,101,51,114")
|
||||||
Geozone.create!(name: I18n.t("seeds.geozones.west_district"),
|
Geozone.create!(name: I18n.t("seeds.geozones.west_district"),
|
||||||
external_code: "002", census_code: "02",
|
external_code: "002", census_code: "02",
|
||||||
html_map_coordinates: "42,153,31,176,24,202,20,221,44,235,59,249,55,320,30,354,"\
|
html_map_coordinates: "42,153,31,176,24,202,20,221,44,235,59,249,55,320,30,354," \
|
||||||
"31,372,52,396,64,432,89,453,116,432,149,419,162,412,165,377,172,357,189,352,228,"\
|
"31,372,52,396,64,432,89,453,116,432,149,419,162,412,165,377,172,357,189,352,228," \
|
||||||
"327,246,313,262,297,234,291,210,284,193,284,176,294,158,303,154,310,146,289,140,"\
|
"327,246,313,262,297,234,291,210,284,193,284,176,294,158,303,154,310,146,289,140," \
|
||||||
"268,138,246,135,236,139,222,151,214,136,197,120,179,99,159,85,149,65,149,56,149")
|
"268,138,246,135,236,139,222,151,214,136,197,120,179,99,159,85,149,65,149,56,149")
|
||||||
Geozone.create!(name: I18n.t("seeds.geozones.east_district"),
|
Geozone.create!(name: I18n.t("seeds.geozones.east_district"),
|
||||||
external_code: "003", census_code: "03",
|
external_code: "003", census_code: "03",
|
||||||
html_map_coordinates: "175,353,162,378,161,407,153,416,167,432,184,447,225,426,"\
|
html_map_coordinates: "175,353,162,378,161,407,153,416,167,432,184,447,225,426," \
|
||||||
"250,409,283,390,298,369,344,363,351,334,356,296,361,267,376,245,378,185,327,188,"\
|
"250,409,283,390,298,369,344,363,351,334,356,296,361,267,376,245,378,185,327,188," \
|
||||||
"281,195,239,216,245,221,245,232,261,244,281,238,300,242,304,251,285,262,278,277,"\
|
"281,195,239,216,245,221,245,232,261,244,281,238,300,242,304,251,285,262,278,277," \
|
||||||
"267,294,249,312,219,333,198,346,184,353")
|
"267,294,249,312,219,333,198,346,184,353")
|
||||||
Geozone.create!(name: I18n.t("seeds.geozones.central_district"),
|
Geozone.create!(name: I18n.t("seeds.geozones.central_district"),
|
||||||
external_code: "004", census_code: "04",
|
external_code: "004", census_code: "04",
|
||||||
html_map_coordinates: "152,308,137,258,133,235,147,216,152,214,186,194,210,196,"\
|
html_map_coordinates: "152,308,137,258,133,235,147,216,152,214,186,194,210,196," \
|
||||||
"228,202,240,216,241,232,263,243,293,241,301,245,302,254,286,265,274,278,267,296,"\
|
"228,202,240,216,241,232,263,243,293,241,301,245,302,254,286,265,274,278,267,296," \
|
||||||
"243,293,226,289,209,285,195,283,177,297")
|
"243,293,226,289,209,285,195,283,177,297")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
section "Creating Newsletters" do
|
section "Creating Newsletters" do
|
||||||
newsletter_body = [
|
newsletter_body = [
|
||||||
"We choose to go to the moon in this decade and do the other things, not because they are easy"\
|
"We choose to go to the moon in this decade and do the other things, not because they are easy" \
|
||||||
", but because they are hard, because that goal will serve to organize and measure the best of"\
|
", but because they are hard, because that goal will serve to organize and measure the best of" \
|
||||||
" our energies and skills, because that challenge is one that we are willing to accept, one we"\
|
" our energies and skills, because that challenge is one that we are willing to accept, one we" \
|
||||||
" are unwilling to postpone, and one which we intend to win.",
|
" are unwilling to postpone, and one which we intend to win.",
|
||||||
"Spaceflights cannot be stopped. This is not the work of any one man or even a group of men."\
|
"Spaceflights cannot be stopped. This is not the work of any one man or even a group of men." \
|
||||||
" It is a historical process which mankind is carrying out in accordance with the natural laws"\
|
" It is a historical process which mankind is carrying out in accordance with the natural laws" \
|
||||||
" of human development.",
|
" of human development.",
|
||||||
"Many say exploration is part of our destiny, but it’s actually our duty to future generations"\
|
"Many say exploration is part of our destiny, but it’s actually our duty to future generations" \
|
||||||
" and their quest to ensure the survival of the human species."
|
" and their quest to ensure the survival of the human species."
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ section "Creating Settings" do
|
|||||||
"feature.featured_proposals": "true",
|
"feature.featured_proposals": "true",
|
||||||
"feature.map": "true",
|
"feature.map": "true",
|
||||||
"instagram_handle": "CONSUL DEMOCRACY",
|
"instagram_handle": "CONSUL DEMOCRACY",
|
||||||
"meta_description": "Citizen participation tool for an open, "\
|
"meta_description": "Citizen participation tool for an open, " \
|
||||||
"transparent and democratic government",
|
"transparent and democratic government",
|
||||||
"meta_keywords": "citizen participation, open government",
|
"meta_keywords": "citizen participation, open government",
|
||||||
"meta_title": "CONSUL DEMOCRACY",
|
"meta_title": "CONSUL DEMOCRACY",
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class CreateSharedExtensionsSchema < ActiveRecord::Migration[6.0]
|
|||||||
execute statement
|
execute statement
|
||||||
else
|
else
|
||||||
log_warning(
|
log_warning(
|
||||||
"GRANT CREATE ON DATABASE #{query_value("SELECT CURRENT_DATABASE()")} "\
|
"GRANT CREATE ON DATABASE #{query_value("SELECT CURRENT_DATABASE()")} " \
|
||||||
"TO #{query_value("SELECT CURRENT_USER")}"
|
"TO #{query_value("SELECT CURRENT_USER")}"
|
||||||
)
|
)
|
||||||
log_warning(statement)
|
log_warning(statement)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ describe Budgets::BudgetComponent do
|
|||||||
render_inline Budgets::BudgetComponent.new(budget)
|
render_inline Budgets::BudgetComponent.new(budget)
|
||||||
|
|
||||||
expect(page).to have_css ".budget-header.with-background-image"
|
expect(page).to have_css ".budget-header.with-background-image"
|
||||||
expect(page).to have_css ".budget-header[style*='background-image:']"\
|
expect(page).to have_css ".budget-header[style*='background-image:']" \
|
||||||
"[style*='url(\\''][style*='clippy(with_brackets).jpg\\'']"
|
"[style*='url(\\''][style*='clippy(with_brackets).jpg\\'']"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ describe Budgets::BudgetComponent do
|
|||||||
render_inline Budgets::BudgetComponent.new(budget)
|
render_inline Budgets::BudgetComponent.new(budget)
|
||||||
|
|
||||||
expect(page).to have_css ".budget-header.with-background-image"
|
expect(page).to have_css ".budget-header.with-background-image"
|
||||||
expect(page).to have_css ".budget-header[style*='background-image:']"\
|
expect(page).to have_css ".budget-header[style*='background-image:']" \
|
||||||
"[style*='url(\\''][style*='clippy_with_\\\\\'quotes\\\\\'.jpg']"
|
"[style*='url(\\''][style*='clippy_with_\\\\\'quotes\\\\\'.jpg']"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -73,36 +73,36 @@ describe Dashboard::Mailer do
|
|||||||
expect(email).to deliver_to(proposal.author)
|
expect(email).to deliver_to(proposal.author)
|
||||||
expect(email).to have_subject("Your draft citizen proposal is created")
|
expect(email).to have_subject("Your draft citizen proposal is created")
|
||||||
expect(email).to have_body_text("Hi #{proposal.author.name}!")
|
expect(email).to have_body_text("Hi #{proposal.author.name}!")
|
||||||
expect(email).to have_body_text("Your #{proposal.title} proposal has been "\
|
expect(email).to have_body_text("Your #{proposal.title} proposal has been " \
|
||||||
"successfully created.")
|
"successfully created.")
|
||||||
expect(email).to have_body_text("Take advantage that your proposal is not public yet and "\
|
expect(email).to have_body_text("Take advantage that your proposal is not public yet and " \
|
||||||
"get ready to contact a lot of people.")
|
"get ready to contact a lot of people.")
|
||||||
expect(email).to have_body_text("When you are ready publish your citizen proposal from this")
|
expect(email).to have_body_text("When you are ready publish your citizen proposal from this")
|
||||||
expect(email).to have_link "link", href: proposal_dashboard_url(proposal)
|
expect(email).to have_link "link", href: proposal_dashboard_url(proposal)
|
||||||
expect(email).to have_body_text("We know that creating a proposal with a hook and getting "\
|
expect(email).to have_body_text("We know that creating a proposal with a hook and getting " \
|
||||||
"the necessary support can seem complicated. But don't "\
|
"the necessary support can seem complicated. But don't " \
|
||||||
"worry because we are going to help you!")
|
"worry because we are going to help you!")
|
||||||
expect(email).to have_body_text("You have a tool that will be your new best ally: "\
|
expect(email).to have_body_text("You have a tool that will be your new best ally: " \
|
||||||
"The Citizen Proposals panel.")
|
"The Citizen Proposals panel.")
|
||||||
expect(email).to have_body_text("Enter every day in the panel of your proposal to use the "\
|
expect(email).to have_body_text("Enter every day in the panel of your proposal to use the " \
|
||||||
"tips and resources that we will share with you.")
|
"tips and resources that we will share with you.")
|
||||||
expect(email).to have_body_text("These tips, actions and resources will give you ideas and "\
|
expect(email).to have_body_text("These tips, actions and resources will give you ideas and " \
|
||||||
"also practical solutions to get more support and a wider "\
|
"also practical solutions to get more support and a wider " \
|
||||||
"community. Dont forget them!")
|
"community. Dont forget them!")
|
||||||
expect(email).to have_body_text("As you gain more support, you will unlock new and better "\
|
expect(email).to have_body_text("As you gain more support, you will unlock new and better " \
|
||||||
"resources. At the moment, you have an e-mail template to "\
|
"resources. At the moment, you have an e-mail template to " \
|
||||||
"send massively to all your contacts, a poster to print, "\
|
"send massively to all your contacts, a poster to print, " \
|
||||||
"among other features and rewards that you will discover. "\
|
"among other features and rewards that you will discover. " \
|
||||||
"Dont stop adding support and we will not stop rewarding "\
|
"Dont stop adding support and we will not stop rewarding " \
|
||||||
"and helping you!")
|
"and helping you!")
|
||||||
expect(email).to have_body_text("You have #{Setting["months_to_archive_proposals"]} months "\
|
expect(email).to have_body_text("You have #{Setting["months_to_archive_proposals"]} months " \
|
||||||
"since you publish the proposal to get "\
|
"since you publish the proposal to get " \
|
||||||
"#{Setting["votes_for_proposal_success"]} support and your "\
|
"#{Setting["votes_for_proposal_success"]} support and your " \
|
||||||
"proposal can become a reality. But the first days are the "\
|
"proposal can become a reality. But the first days are the " \
|
||||||
"most important. It is a challenge. Get ready!")
|
"most important. It is a challenge. Get ready!")
|
||||||
expect(email).to have_body_text("And for you to start with all the motivation,")
|
expect(email).to have_body_text("And for you to start with all the motivation,")
|
||||||
expect(email).to have_body_text("here you have several resources and a whole list of "\
|
expect(email).to have_body_text("here you have several resources and a whole list of " \
|
||||||
"tips that will come to you every day to prepare the "\
|
"tips that will come to you every day to prepare the " \
|
||||||
"broadcast!")
|
"broadcast!")
|
||||||
expect(email).to have_body_text("Go ahead, discover them!")
|
expect(email).to have_body_text("Go ahead, discover them!")
|
||||||
end
|
end
|
||||||
@@ -135,33 +135,33 @@ describe Dashboard::Mailer do
|
|||||||
|
|
||||||
expect(email).to deliver_from("CONSUL <noreply@consul.dev>")
|
expect(email).to deliver_from("CONSUL <noreply@consul.dev>")
|
||||||
expect(email).to deliver_to(proposal.author)
|
expect(email).to deliver_to(proposal.author)
|
||||||
expect(email).to have_subject("Your citizen proposal is already "\
|
expect(email).to have_subject("Your citizen proposal is already " \
|
||||||
"published. Don't stop spreading!")
|
"published. Don't stop spreading!")
|
||||||
expect(email).to have_body_text("Congratulations #{proposal.author.name}! Your proposal "\
|
expect(email).to have_body_text("Congratulations #{proposal.author.name}! Your proposal " \
|
||||||
"#{proposal.title} has been created successfully.")
|
"#{proposal.title} has been created successfully.")
|
||||||
expect(email).to have_body_text("And now, go for your first 100 supports!")
|
expect(email).to have_body_text("And now, go for your first 100 supports!")
|
||||||
expect(email).to have_body_text("Why 100?")
|
expect(email).to have_body_text("Why 100?")
|
||||||
expect(email).to have_body_text("Our experience tells us that the first day is fundamental. "\
|
expect(email).to have_body_text("Our experience tells us that the first day is fundamental. " \
|
||||||
"Because in addition to having the energy to launch "\
|
"Because in addition to having the energy to launch " \
|
||||||
"something new, being a newly published proposal, you will "\
|
"something new, being a newly published proposal, you will " \
|
||||||
"have the important visibility of being among the new "\
|
"have the important visibility of being among the new " \
|
||||||
"proposals highlighted.")
|
"proposals highlighted.")
|
||||||
expect(email).to have_body_text("Get 100 supports on the first day, and you will have "\
|
expect(email).to have_body_text("Get 100 supports on the first day, and you will have " \
|
||||||
"a first community to back you up.")
|
"a first community to back you up.")
|
||||||
expect(email).to have_body_text("That is why we challenge you to get it, but not without "\
|
expect(email).to have_body_text("That is why we challenge you to get it, but not without " \
|
||||||
"a lot of help!")
|
"a lot of help!")
|
||||||
expect(email).to have_body_text("Remember that in your Proposal Panel you have new "\
|
expect(email).to have_body_text("Remember that in your Proposal Panel you have new " \
|
||||||
"resources available and recommendations for "\
|
"resources available and recommendations for " \
|
||||||
"dissemination actions.")
|
"dissemination actions.")
|
||||||
expect(email).to have_body_text("Come in every day to see your progress and use the tips "\
|
expect(email).to have_body_text("Come in every day to see your progress and use the tips " \
|
||||||
"and resources we will share with you. They are ideas and "\
|
"and resources we will share with you. They are ideas and " \
|
||||||
"also practical solutions to get the support you need.")
|
"also practical solutions to get the support you need.")
|
||||||
expect(email).to have_body_text("As you get more support, you will unlock new and better "\
|
expect(email).to have_body_text("As you get more support, you will unlock new and better " \
|
||||||
"resources. Do not stop adding support and we will not stop "\
|
"resources. Do not stop adding support and we will not stop " \
|
||||||
"rewarding and helping you!")
|
"rewarding and helping you!")
|
||||||
expect(email).to have_body_text("And for you to start at full speed...")
|
expect(email).to have_body_text("And for you to start at full speed...")
|
||||||
expect(email).to have_body_text("Here is a great resource at your disposal!")
|
expect(email).to have_body_text("Here is a great resource at your disposal!")
|
||||||
expect(email).to have_body_text("You will also find this new recommended dissemination "\
|
expect(email).to have_body_text("You will also find this new recommended dissemination " \
|
||||||
"action...")
|
"action...")
|
||||||
expect(email).to have_body_text("You sure have more resources to use!")
|
expect(email).to have_body_text("You sure have more resources to use!")
|
||||||
expect(email).to have_body_text("Go ahead, discover them!")
|
expect(email).to have_body_text("Go ahead, discover them!")
|
||||||
|
|||||||
@@ -10,16 +10,16 @@ RSpec.describe Legislation::Annotation, type: :model do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "calculates the context for multinode annotations" do
|
it "calculates the context for multinode annotations" do
|
||||||
quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam"\
|
quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam" \
|
||||||
" erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex"\
|
" erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex" \
|
||||||
" ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum"\
|
" ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum" \
|
||||||
" dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril"\
|
" dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril" \
|
||||||
" delenit augue duis dolore te feugait nulla facilisi."\
|
" delenit augue duis dolore te feugait nulla facilisi." \
|
||||||
"\n\n"\
|
"\n\n" \
|
||||||
"Expetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi"\
|
"Expetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi" \
|
||||||
" tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis"\
|
" tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis" \
|
||||||
" ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."\
|
" ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id." \
|
||||||
"\n\n"\
|
"\n\n" \
|
||||||
"His audiam"
|
"His audiam"
|
||||||
annotation = create(
|
annotation = create(
|
||||||
:legislation_annotation,
|
:legislation_annotation,
|
||||||
@@ -28,24 +28,24 @@ RSpec.describe Legislation::Annotation, type: :model do
|
|||||||
ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }]
|
ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }]
|
||||||
)
|
)
|
||||||
|
|
||||||
context = "Lorem <span class=annotator-hl>ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt"\
|
context = "Lorem <span class=annotator-hl>ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt" \
|
||||||
" ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper"\
|
" ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper" \
|
||||||
" suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\
|
" suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit" \
|
||||||
" esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\
|
" esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui" \
|
||||||
" blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nExpetenda tincidunt in sed, ex"\
|
" blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nExpetenda tincidunt in sed, ex" \
|
||||||
" partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\
|
" partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute" \
|
||||||
" aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\
|
" aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit" \
|
||||||
" iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id.\n\nHis audiam</span>deserunt in, eum"\
|
" iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id.\n\nHis audiam</span>deserunt in, eum" \
|
||||||
" ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at"\
|
" ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at" \
|
||||||
" quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim"\
|
" quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim" \
|
||||||
" alterum qui cu. Accusamus consulatu ius te, cu decore soleat appareat usu."
|
" alterum qui cu. Accusamus consulatu ius te, cu decore soleat appareat usu."
|
||||||
expect(annotation.context).to eq(context)
|
expect(annotation.context).to eq(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "calculates the context for multinode annotations 2" do
|
it "calculates the context for multinode annotations 2" do
|
||||||
quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla"\
|
quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla" \
|
||||||
" facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore"\
|
" facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore" \
|
||||||
" te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant"\
|
" te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant" \
|
||||||
" aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo"
|
" aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo"
|
||||||
annotation = create(
|
annotation = create(
|
||||||
:legislation_annotation,
|
:legislation_annotation,
|
||||||
@@ -54,44 +54,44 @@ RSpec.describe Legislation::Annotation, type: :model do
|
|||||||
ranges: [{ "start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190 }]
|
ranges: [{ "start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190 }]
|
||||||
)
|
)
|
||||||
|
|
||||||
context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna"\
|
context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna" \
|
||||||
" aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut"\
|
" aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut" \
|
||||||
" aliquip ex ea commodo consequat. <span class=annotator-hl>Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\
|
" aliquip ex ea commodo consequat. <span class=annotator-hl>Duis autem vel eum iriure dolor in hendrerit in vulputate velit" \
|
||||||
" esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\
|
" esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui" \
|
||||||
" blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex"\
|
" blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex" \
|
||||||
" partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\
|
" partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute" \
|
||||||
" aliquando ius ex. Ea aperiri sententiae duo</span>. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\
|
" aliquando ius ex. Ea aperiri sententiae duo</span>. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit" \
|
||||||
" iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."
|
" iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."
|
||||||
expect(annotation.context).to eq(context)
|
expect(annotation.context).to eq(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "calculates the context for multinode annotations 3" do
|
it "calculates the context for multinode annotations 3" do
|
||||||
body = "The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed"\
|
body = "The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed" \
|
||||||
" to ensure cooperation with the community in the case of network server software.\r\n\r\nThe licenses for most software and"\
|
" to ensure cooperation with the community in the case of network server software.\r\n\r\nThe licenses for most software and" \
|
||||||
" other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public"\
|
" other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public" \
|
||||||
" Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free"\
|
" Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free" \
|
||||||
" software for all its users.\r\n\r\nWhen we speak of free software, we are referring to freedom, not price. Our General"\
|
" software for all its users.\r\n\r\nWhen we speak of free software, we are referring to freedom, not price. Our General" \
|
||||||
" Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for"\
|
" Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for" \
|
||||||
" them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces"\
|
" them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces" \
|
||||||
" of it in new free programs, and that you know you can do these things.\r\n\r\nDevelopers that use our General Public Licenses"\
|
" of it in new free programs, and that you know you can do these things.\r\n\r\nDevelopers that use our General Public Licenses" \
|
||||||
" protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you"\
|
" protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you" \
|
||||||
" legal permission to copy, distribute and/or modify the software.\r\n\r\nA secondary benefit of defending all users' freedom"\
|
" legal permission to copy, distribute and/or modify the software.\r\n\r\nA secondary benefit of defending all users' freedom" \
|
||||||
" is that improvements made in alternate versions of the program, if they receive widespread use, become available for other"\
|
" is that improvements made in alternate versions of the program, if they receive widespread use, become available for other" \
|
||||||
" developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation."\
|
" developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation." \
|
||||||
" However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License"\
|
" However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License" \
|
||||||
" permits making a modified version and letting the public access it on a server without ever releasing its source code to the"\
|
" permits making a modified version and letting the public access it on a server without ever releasing its source code to the" \
|
||||||
" public.\r\n\r\nThe GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified"\
|
" public.\r\n\r\nThe GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified" \
|
||||||
" source code becomes available to the community. It requires the operator of a network server to provide the source code of"\
|
" source code becomes available to the community. It requires the operator of a network server to provide the source code of" \
|
||||||
" the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly"\
|
" the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly" \
|
||||||
" accessible server, gives the public access to the source code of the modified version.\r\n\r\nAn older license, called the"\
|
" accessible server, gives the public access to the source code of the modified version.\r\n\r\nAn older license, called the" \
|
||||||
" Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license,"\
|
" Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license," \
|
||||||
" not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this"\
|
" not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this" \
|
||||||
" license."
|
" license."
|
||||||
draft_version = create(:legislation_draft_version, body: body)
|
draft_version = create(:legislation_draft_version, body: body)
|
||||||
|
|
||||||
quote = "By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a"\
|
quote = "By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a" \
|
||||||
" program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of free software, we are referring to"\
|
" program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of free software, we are referring to" \
|
||||||
" freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of"\
|
" freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of" \
|
||||||
" free software (and charge for them if you wish)"
|
" free software (and charge for them if you wish)"
|
||||||
|
|
||||||
annotation = create(
|
annotation = create(
|
||||||
@@ -101,12 +101,12 @@ RSpec.describe Legislation::Annotation, type: :model do
|
|||||||
ranges: [{ "start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223 }]
|
ranges: [{ "start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223 }]
|
||||||
)
|
)
|
||||||
|
|
||||||
context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the"\
|
context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the" \
|
||||||
" works. <span class=annotator-hl>By contrast, our General Public Licenses are intended to guarantee your freedom to share"\
|
" works. <span class=annotator-hl>By contrast, our General Public Licenses are intended to guarantee your freedom to share" \
|
||||||
" and change all versions of a program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of"\
|
" and change all versions of a program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of" \
|
||||||
" free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have"\
|
" free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have" \
|
||||||
" the freedom to distribute copies of free software (and charge for them if you wish)</span>, that you receive source code"\
|
" the freedom to distribute copies of free software (and charge for them if you wish)</span>, that you receive source code" \
|
||||||
" or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know"\
|
" or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know" \
|
||||||
" you can do these things."
|
" you can do these things."
|
||||||
|
|
||||||
expect(annotation.context).to eq(context)
|
expect(annotation.context).to eq(context)
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ describe "Account" do
|
|||||||
|
|
||||||
click_button "Update"
|
click_button "Update"
|
||||||
|
|
||||||
notice = "Your account has been updated successfully;"\
|
notice = "Your account has been updated successfully;" \
|
||||||
" however, we need to verify your new email address."\
|
" however, we need to verify your new email address." \
|
||||||
" Please check your email and click on the link to"\
|
" Please check your email and click on the link to" \
|
||||||
" complete the confirmation of your new email address."
|
" complete the confirmation of your new email address."
|
||||||
expect(page).to have_content notice
|
expect(page).to have_content notice
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe "Admin administrators" do
|
|||||||
scenario "Delete Administrator" do
|
scenario "Delete Administrator" do
|
||||||
visit admin_administrators_path
|
visit admin_administrators_path
|
||||||
|
|
||||||
confirmation = "Are you sure? This action will delete "\
|
confirmation = "Are you sure? This action will delete " \
|
||||||
"\"#{user_administrator.name}\" and can't be undone."
|
"\"#{user_administrator.name}\" and can't be undone."
|
||||||
|
|
||||||
within "#administrator_#{user_administrator.id}" do
|
within "#administrator_#{user_administrator.id}" do
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ describe "Admin budget investments", :admin do
|
|||||||
click_button "Filter"
|
click_button "Filter"
|
||||||
|
|
||||||
expect(page).not_to have_button "Calculate Winner Investments"
|
expect(page).not_to have_button "Calculate Winner Investments"
|
||||||
expect(page).to have_content 'The budget has to stay on phase "Reviewing voting" '\
|
expect(page).to have_content 'The budget has to stay on phase "Reviewing voting" ' \
|
||||||
"in order to calculate winners projects"
|
"in order to calculate winners projects"
|
||||||
|
|
||||||
visit admin_budget_path(budget)
|
visit admin_budget_path(budget)
|
||||||
@@ -1720,12 +1720,12 @@ describe "Admin budget investments", :admin do
|
|||||||
expect(header).to match(/^attachment/)
|
expect(header).to match(/^attachment/)
|
||||||
expect(header).to match(/filename="budget_investments.csv"/)
|
expect(header).to match(/filename="budget_investments.csv"/)
|
||||||
|
|
||||||
csv_contents = "ID,Title,Supports,Administrator,Valuator,Valuation Group,Scope of operation,"\
|
csv_contents = "ID,Title,Supports,Administrator,Valuator,Valuation Group,Scope of operation," \
|
||||||
"Feasibility,Val. Fin.,Selected,Show to valuators,Author username\n"\
|
"Feasibility,Val. Fin.,Selected,Show to valuators,Author username\n" \
|
||||||
"#{first_investment.id},Le Investment,88,Admin,-,Valuator Group,"\
|
"#{first_investment.id},Le Investment,88,Admin,-,Valuator Group," \
|
||||||
"Budget Heading,Feasible (€99),Yes,Yes,Yes,"\
|
"Budget Heading,Feasible (€99),Yes,Yes,Yes," \
|
||||||
"#{first_investment.author.username}\n#{second_investment.id},"\
|
"#{first_investment.author.username}\n#{second_investment.id}," \
|
||||||
"Alt Investment,66,No admin assigned,Valuator,-,Other Heading,"\
|
"Alt Investment,66,No admin assigned,Valuator,-,Other Heading," \
|
||||||
"Unfeasible,No,No,No,#{second_investment.author.username}\n"
|
"Unfeasible,No,No,No,#{second_investment.author.username}\n"
|
||||||
|
|
||||||
expect(page.body).to eq(csv_contents)
|
expect(page.body).to eq(csv_contents)
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ describe "Admin budget phases" do
|
|||||||
scenario "Update phase" do
|
scenario "Update phase" do
|
||||||
visit edit_admin_budget_budget_phase_path(budget, budget.current_phase)
|
visit edit_admin_budget_budget_phase_path(budget, budget.current_phase)
|
||||||
|
|
||||||
expect(page).to have_content "These fields are used for information purposes only and do not trigger "\
|
expect(page).to have_content "These fields are used for information purposes only and do not trigger " \
|
||||||
"an automatic update of the active phase. In order to update it, edit "\
|
"an automatic update of the active phase. In order to update it, edit " \
|
||||||
"the budget and select the active phase."
|
"the budget and select the active phase."
|
||||||
expect(page).to have_content "For information purposes only"
|
expect(page).to have_content "For information purposes only"
|
||||||
|
|
||||||
|
|||||||
@@ -235,8 +235,8 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
visit admin_budget_path(budget)
|
visit admin_budget_path(budget)
|
||||||
|
|
||||||
expect(page).to have_content "The configuration of these phases is used for information purposes "\
|
expect(page).to have_content "The configuration of these phases is used for information purposes " \
|
||||||
"only. Its function is to define the phases information displayed "\
|
"only. Its function is to define the phases information displayed " \
|
||||||
"on the public page of the participatory budget."
|
"on the public page of the participatory budget."
|
||||||
expect(page).to have_table "Phases", with_cols: [
|
expect(page).to have_table "Phases", with_cols: [
|
||||||
[
|
[
|
||||||
@@ -357,7 +357,7 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
scenario "Change voting style uncheck hide money" do
|
scenario "Change voting style uncheck hide money" do
|
||||||
budget_hide_money = create(:budget, :approval, :hide_money)
|
budget_hide_money = create(:budget, :approval, :hide_money)
|
||||||
hide_money_help_text = "If this option is checked, all fields showing the amount of money "\
|
hide_money_help_text = "If this option is checked, all fields showing the amount of money " \
|
||||||
"will be hidden throughout the process."
|
"will be hidden throughout the process."
|
||||||
|
|
||||||
visit edit_admin_budget_path(budget_hide_money)
|
visit edit_admin_budget_path(budget_hide_money)
|
||||||
@@ -378,7 +378,7 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
scenario "Edit knapsack budget do not show hide money info" do
|
scenario "Edit knapsack budget do not show hide money info" do
|
||||||
budget = create(:budget, :knapsack)
|
budget = create(:budget, :knapsack)
|
||||||
hide_money_help_text = "If this option is checked, all fields showing the amount of money "\
|
hide_money_help_text = "If this option is checked, all fields showing the amount of money " \
|
||||||
"will be hidden throughout the process."
|
"will be hidden throughout the process."
|
||||||
|
|
||||||
visit edit_admin_budget_path(budget)
|
visit edit_admin_budget_path(budget)
|
||||||
@@ -394,7 +394,7 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
scenario "Edit approval budget show hide money info" do
|
scenario "Edit approval budget show hide money info" do
|
||||||
budget = create(:budget, :approval)
|
budget = create(:budget, :approval)
|
||||||
hide_money_help_text = "If this option is checked, all fields showing the amount of money "\
|
hide_money_help_text = "If this option is checked, all fields showing the amount of money " \
|
||||||
"will be hidden throughout the process."
|
"will be hidden throughout the process."
|
||||||
|
|
||||||
visit edit_admin_budget_path(budget)
|
visit edit_admin_budget_path(budget)
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ describe "Admin local census records", :admin do
|
|||||||
|
|
||||||
expect(page).to have_content deleted_document_number
|
expect(page).to have_content deleted_document_number
|
||||||
|
|
||||||
confirmation = "Are you sure? This action will delete "\
|
confirmation = "Are you sure? This action will delete " \
|
||||||
"\"#{local_census_record.title}\" and can't be undone."
|
"\"#{local_census_record.title}\" and can't be undone."
|
||||||
|
|
||||||
accept_confirm(confirmation) { click_on "Delete" }
|
accept_confirm(confirmation) { click_on "Delete" }
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ describe "Machine learning" do
|
|||||||
|
|
||||||
visit admin_machine_learning_path
|
visit admin_machine_learning_path
|
||||||
|
|
||||||
expect(page).to have_content "This feature is disabled. To use Machine Learning you can enable it from "\
|
expect(page).to have_content "This feature is disabled. To use Machine Learning you can enable it from " \
|
||||||
"the settings page"
|
"the settings page"
|
||||||
expect(page).to have_link "settings page", href: admin_settings_path(anchor: "tab-feature-flags")
|
expect(page).to have_link "settings page", href: admin_settings_path(anchor: "tab-feature-flags")
|
||||||
end
|
end
|
||||||
@@ -56,7 +56,7 @@ describe "Machine learning" do
|
|||||||
click_button "Execute script"
|
click_button "Execute script"
|
||||||
|
|
||||||
expect(page).to have_content "The last script has been executed successfully."
|
expect(page).to have_content "The last script has been executed successfully."
|
||||||
expect(page).to have_content "You will receive an email in #{admin.email} when the script "\
|
expect(page).to have_content "You will receive an email in #{admin.email} when the script " \
|
||||||
"finishes running."
|
"finishes running."
|
||||||
|
|
||||||
expect(page).to have_field "Select python script to execute"
|
expect(page).to have_field "Select python script to execute"
|
||||||
@@ -71,11 +71,11 @@ describe "Machine learning" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content "Related content"
|
expect(page).to have_content "Related content"
|
||||||
expect(page).to have_content "Adds automatically generated related content to proposals and "\
|
expect(page).to have_content "Adds automatically generated related content to proposals and " \
|
||||||
"participatory budget projects"
|
"participatory budget projects"
|
||||||
|
|
||||||
expect(page).to have_content "Comments summary"
|
expect(page).to have_content "Comments summary"
|
||||||
expect(page).to have_content "Displays an automatically generated comment summary on all items that "\
|
expect(page).to have_content "Displays an automatically generated comment summary on all items that " \
|
||||||
"can be commented on."
|
"can be commented on."
|
||||||
|
|
||||||
expect(page).to have_content "Tags"
|
expect(page).to have_content "Tags"
|
||||||
@@ -94,7 +94,7 @@ describe "Machine learning" do
|
|||||||
select "proposals_related_content_and_tags_nmf.py", from: "Select python script to execute"
|
select "proposals_related_content_and_tags_nmf.py", from: "Select python script to execute"
|
||||||
click_button "Execute script"
|
click_button "Execute script"
|
||||||
|
|
||||||
expect(page).to have_content "The script is running. The administrator who executed it will receive "\
|
expect(page).to have_content "The script is running. The administrator who executed it will receive " \
|
||||||
"an email when it is finished."
|
"an email when it is finished."
|
||||||
|
|
||||||
expect(page).to have_content "Executed by: #{admin.name}"
|
expect(page).to have_content "Executed by: #{admin.name}"
|
||||||
@@ -139,7 +139,7 @@ describe "Machine learning" do
|
|||||||
expect(page).to have_content "Script name: proposals_related_content_and_tags_nmf.py"
|
expect(page).to have_content "Script name: proposals_related_content_and_tags_nmf.py"
|
||||||
expect(page).to have_content "Error: Error description"
|
expect(page).to have_content "Error: Error description"
|
||||||
|
|
||||||
expect(page).to have_content "You will receive an email in #{admin.email} when the script "\
|
expect(page).to have_content "You will receive an email in #{admin.email} when the script " \
|
||||||
"finishes running."
|
"finishes running."
|
||||||
|
|
||||||
expect(page).to have_field "Select python script to execute"
|
expect(page).to have_field "Select python script to execute"
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ describe "System Emails" do
|
|||||||
|
|
||||||
expect(page).to have_content "New evaluation comment for Cleaner city"
|
expect(page).to have_content "New evaluation comment for Cleaner city"
|
||||||
expect(page).to have_content "Hi #{admin.name}"
|
expect(page).to have_content "Hi #{admin.name}"
|
||||||
expect(page).to have_content "There is a new evaluation comment from #{comment.user.name} "\
|
expect(page).to have_content "There is a new evaluation comment from #{comment.user.name} " \
|
||||||
"to the budget investment Cleaner city"
|
"to the budget investment Cleaner city"
|
||||||
expect(page).to have_content comment.body
|
expect(page).to have_content comment.body
|
||||||
|
|
||||||
|
|||||||
@@ -603,7 +603,7 @@ describe "Budget Investments" do
|
|||||||
fill_in_new_investment_title with: "Build a skyscraper"
|
fill_in_new_investment_title with: "Build a skyscraper"
|
||||||
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
||||||
fill_in "Location additional info", with: "City center"
|
fill_in "Location additional info", with: "City center"
|
||||||
fill_in "If you are proposing in the name of a collective/organization, "\
|
fill_in "If you are proposing in the name of a collective/organization, " \
|
||||||
"or on behalf of more people, write its name", with: "T.I.A."
|
"or on behalf of more people, write its name", with: "T.I.A."
|
||||||
fill_in "Tags", with: "Towers"
|
fill_in "Tags", with: "Towers"
|
||||||
check "I agree to the Privacy Policy and the Terms and conditions of use"
|
check "I agree to the Privacy Policy and the Terms and conditions of use"
|
||||||
@@ -668,7 +668,7 @@ describe "Budget Investments" do
|
|||||||
fill_in_new_investment_title with: "Build a skyscraper"
|
fill_in_new_investment_title with: "Build a skyscraper"
|
||||||
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds"
|
||||||
fill_in "Location additional info", with: "City center"
|
fill_in "Location additional info", with: "City center"
|
||||||
fill_in "If you are proposing in the name of a collective/organization, "\
|
fill_in "If you are proposing in the name of a collective/organization, " \
|
||||||
"or on behalf of more people, write its name", with: "T.I.A."
|
"or on behalf of more people, write its name", with: "T.I.A."
|
||||||
fill_in "Tags", with: "Towers"
|
fill_in "Tags", with: "Towers"
|
||||||
check "I agree to the Privacy Policy and the Terms and conditions of use"
|
check "I agree to the Privacy Policy and the Terms and conditions of use"
|
||||||
@@ -1000,14 +1000,14 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
expect(page).not_to have_content("Unfeasibility explanation")
|
expect(page).not_to have_content("Unfeasibility explanation")
|
||||||
expect(page).not_to have_content("Local government is not competent in this")
|
expect(page).not_to have_content("Local government is not competent in this")
|
||||||
expect(page).not_to have_content("This investment project has been marked as not feasible "\
|
expect(page).not_to have_content("This investment project has been marked as not feasible " \
|
||||||
"and will not go to balloting phase")
|
"and will not go to balloting phase")
|
||||||
|
|
||||||
visit budget_investment_path(budget, id: investment_2.id)
|
visit budget_investment_path(budget, id: investment_2.id)
|
||||||
|
|
||||||
expect(page).to have_content("Unfeasibility explanation")
|
expect(page).to have_content("Unfeasibility explanation")
|
||||||
expect(page).to have_content("The unfeasible explanation")
|
expect(page).to have_content("The unfeasible explanation")
|
||||||
expect(page).to have_content("This investment project has been marked as not feasible "\
|
expect(page).to have_content("This investment project has been marked as not feasible " \
|
||||||
"and will not go to balloting phase")
|
"and will not go to balloting phase")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1472,7 +1472,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit budget_ballot_path(budget)
|
visit budget_ballot_path(budget)
|
||||||
|
|
||||||
expect(page).to have_content "But you can change your vote at any time "\
|
expect(page).to have_content "But you can change your vote at any time " \
|
||||||
"until this phase is closed."
|
"until this phase is closed."
|
||||||
|
|
||||||
within("#budget_group_#{global_group.id}") do
|
within("#budget_group_#{global_group.id}") do
|
||||||
|
|||||||
@@ -20,17 +20,17 @@ describe "Votes" do
|
|||||||
|
|
||||||
within("#budget-investments") do
|
within("#budget-investments") do
|
||||||
within("#budget_investment_#{investment1.id}_votes") do
|
within("#budget_investment_#{investment1.id}_votes") do
|
||||||
expect(page).to have_content "You have already supported this investment project. "\
|
expect(page).to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
|
|
||||||
within("#budget_investment_#{investment2.id}_votes") do
|
within("#budget_investment_#{investment2.id}_votes") do
|
||||||
expect(page).not_to have_content "You have already supported this investment project. "\
|
expect(page).not_to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
|
|
||||||
within("#budget_investment_#{investment3.id}_votes") do
|
within("#budget_investment_#{investment3.id}_votes") do
|
||||||
expect(page).not_to have_content "You have already supported this investment project. "\
|
expect(page).not_to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -45,7 +45,7 @@ describe "Votes" do
|
|||||||
click_button "Support"
|
click_button "Support"
|
||||||
|
|
||||||
expect(page).to have_content "1 support"
|
expect(page).to have_content "1 support"
|
||||||
expect(page).to have_content "You have already supported this investment project. "\
|
expect(page).to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -77,7 +77,7 @@ describe "Votes" do
|
|||||||
click_button "Support"
|
click_button "Support"
|
||||||
|
|
||||||
expect(page).to have_content "1 support"
|
expect(page).to have_content "1 support"
|
||||||
expect(page).to have_content "You have already supported this investment project. "\
|
expect(page).to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -123,7 +123,7 @@ describe "Votes" do
|
|||||||
accept_confirm { click_button "Support" }
|
accept_confirm { click_button "Support" }
|
||||||
|
|
||||||
expect(page).to have_content "1 support"
|
expect(page).to have_content "1 support"
|
||||||
expect(page).to have_content "You have already supported this investment project. "\
|
expect(page).to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ describe "Votes" do
|
|||||||
click_button "Support"
|
click_button "Support"
|
||||||
|
|
||||||
expect(page).to have_content "1 support"
|
expect(page).to have_content "1 support"
|
||||||
expect(page).to have_content "You have already supported this investment project. "\
|
expect(page).to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ describe "Votes" do
|
|||||||
within("#budget_investment_#{third_heading_investment.id}") do
|
within("#budget_investment_#{third_heading_investment.id}") do
|
||||||
click_button "Support"
|
click_button "Support"
|
||||||
|
|
||||||
expect(page).to have_content "You can only support investment projects in 2 districts. "\
|
expect(page).to have_content "You can only support investment projects in 2 districts. " \
|
||||||
"You have already supported investments in"
|
"You have already supported investments in"
|
||||||
|
|
||||||
participation = find(".participation-not-allowed")
|
participation = find(".participation-not-allowed")
|
||||||
@@ -154,7 +154,7 @@ describe "Votes" do
|
|||||||
expect(headings).to match_array [new_york.name, san_francisco.name]
|
expect(headings).to match_array [new_york.name, san_francisco.name]
|
||||||
|
|
||||||
expect(page).not_to have_content "1 support"
|
expect(page).not_to have_content "1 support"
|
||||||
expect(page).not_to have_content "You have already supported this investment project. "\
|
expect(page).not_to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -178,7 +178,7 @@ describe "Votes" do
|
|||||||
|
|
||||||
click_button "Support"
|
click_button "Support"
|
||||||
|
|
||||||
expect(page).to have_content "You can only support investment projects in 2 districts. "\
|
expect(page).to have_content "You can only support investment projects in 2 districts. " \
|
||||||
"You have already supported investments in"
|
"You have already supported investments in"
|
||||||
|
|
||||||
participation = find(".participation-not-allowed")
|
participation = find(".participation-not-allowed")
|
||||||
@@ -188,7 +188,7 @@ describe "Votes" do
|
|||||||
expect(headings).to match_array [new_york.name, san_francisco.name]
|
expect(headings).to match_array [new_york.name, san_francisco.name]
|
||||||
|
|
||||||
expect(page).not_to have_content "1 support"
|
expect(page).not_to have_content "1 support"
|
||||||
expect(page).not_to have_content "You have already supported this investment project. "\
|
expect(page).not_to have_content "You have already supported this investment project. " \
|
||||||
"Share it!"
|
"Share it!"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ describe "Internal valuation comments on Budget::Investments" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Sanitizes comment body for security" do
|
scenario "Sanitizes comment body for security" do
|
||||||
comment_with_js = "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">"\
|
comment_with_js = "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">" \
|
||||||
"click me<a/> http://www.url.com"
|
"click me<a/> http://www.url.com"
|
||||||
create(:comment, :valuation, author: admin_user, commentable: investment,
|
create(:comment, :valuation, author: admin_user, commentable: investment,
|
||||||
body: comment_with_js)
|
body: comment_with_js)
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ describe "Proposal's dashboard" do
|
|||||||
scenario "Dashboard progress show proposed actions truncated description" do
|
scenario "Dashboard progress show proposed actions truncated description" do
|
||||||
action = create(:dashboard_action, :proposed_action, :active, description: "One short action")
|
action = create(:dashboard_action, :proposed_action, :active, description: "One short action")
|
||||||
action_long = create(:dashboard_action, :proposed_action, :active,
|
action_long = create(:dashboard_action, :proposed_action, :active,
|
||||||
description: "This is a really very long description for a proposed "\
|
description: "This is a really very long description for a proposed " \
|
||||||
"action on progress dashboard section, so this description "\
|
"action on progress dashboard section, so this description " \
|
||||||
"should be appear truncated and shows the show description "\
|
"should be appear truncated and shows the show description " \
|
||||||
"link to show the complete description to the users.")
|
"link to show the complete description to the users.")
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
@@ -273,7 +273,7 @@ describe "Proposal's dashboard" do
|
|||||||
click_link(feature.title)
|
click_link(feature.title)
|
||||||
|
|
||||||
click_button "Request"
|
click_button "Request"
|
||||||
expect(page).to have_content("The request has been successfully sent. We will contact you "\
|
expect(page).to have_content("The request has been successfully sent. We will contact you " \
|
||||||
"as soon as possible to inform you about it.")
|
"as soon as possible to inform you about it.")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ describe "Proposal's dashboard" do
|
|||||||
end
|
end
|
||||||
click_button "Request"
|
click_button "Request"
|
||||||
|
|
||||||
expect(page).to have_content("The request has been successfully sent. We will contact you "\
|
expect(page).to have_content("The request has been successfully sent. We will contact you " \
|
||||||
"as soon as possible to inform you about it.")
|
"as soon as possible to inform you about it.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe "Proposal Notifications" do
|
|||||||
click_link "Send notification to proposal followers"
|
click_link "Send notification to proposal followers"
|
||||||
|
|
||||||
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
||||||
fill_in "proposal_notification_body", with: "Please share it with "\
|
fill_in "proposal_notification_body", with: "Please share it with " \
|
||||||
"others so we can make it happen!"
|
"others so we can make it happen!"
|
||||||
click_button "Send notification"
|
click_button "Send notification"
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ describe "Proposal Notifications" do
|
|||||||
login_as(author)
|
login_as(author)
|
||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
expect(page).to have_content "This notification will be sent to 7 people and it will "\
|
expect(page).to have_content "This notification will be sent to 7 people and it will " \
|
||||||
"be visible in the proposal's page"
|
"be visible in the proposal's page"
|
||||||
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
||||||
anchor: "comments"))
|
anchor: "comments"))
|
||||||
@@ -120,7 +120,7 @@ describe "Proposal Notifications" do
|
|||||||
login_as(author)
|
login_as(author)
|
||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
expect(page).to have_content "This notification will be sent to 7 people and it will "\
|
expect(page).to have_content "This notification will be sent to 7 people and it will " \
|
||||||
"be visible in the proposal's page"
|
"be visible in the proposal's page"
|
||||||
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
||||||
anchor: "comments"))
|
anchor: "comments"))
|
||||||
@@ -135,7 +135,7 @@ describe "Proposal Notifications" do
|
|||||||
login_as(author)
|
login_as(author)
|
||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
expect(page).to have_content "This notification will be sent to 1 people and it will "\
|
expect(page).to have_content "This notification will be sent to 1 people and it will " \
|
||||||
"be visible in the proposal's page"
|
"be visible in the proposal's page"
|
||||||
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
expect(page).to have_link("the proposal's page", href: proposal_path(proposal,
|
||||||
anchor: "comments"))
|
anchor: "comments"))
|
||||||
@@ -190,7 +190,7 @@ describe "Proposal Notifications" do
|
|||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
||||||
fill_in "proposal_notification_body", with: "Please share it with "\
|
fill_in "proposal_notification_body", with: "Please share it with " \
|
||||||
"others so we can make it happen!"
|
"others so we can make it happen!"
|
||||||
click_button "Send notification"
|
click_button "Send notification"
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ describe "Proposal Notifications" do
|
|||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
||||||
fill_in "proposal_notification_body", with: "Please share it with "\
|
fill_in "proposal_notification_body", with: "Please share it with " \
|
||||||
"others so we can make it happen!"
|
"others so we can make it happen!"
|
||||||
click_button "Send notification"
|
click_button "Send notification"
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ describe "Proposal Notifications" do
|
|||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
fill_in "proposal_notification_title", with: "Thank you for supporting my proposal"
|
||||||
fill_in "proposal_notification_body", with: "Please share it with "\
|
fill_in "proposal_notification_body", with: "Please share it with " \
|
||||||
"others so we can make it happen!"
|
"others so we can make it happen!"
|
||||||
click_button "Send notification"
|
click_button "Send notification"
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ describe "Local Targets" do
|
|||||||
sdg_local_target = create(:sdg_local_target, code: "1.1.1")
|
sdg_local_target = create(:sdg_local_target, code: "1.1.1")
|
||||||
visit sdg_management_local_targets_path
|
visit sdg_management_local_targets_path
|
||||||
|
|
||||||
confirmation = "Are you sure? This action will delete "\
|
confirmation = "Are you sure? This action will delete " \
|
||||||
"\"#{sdg_local_target.title}\" and can't be undone."
|
"\"#{sdg_local_target.title}\" and can't be undone."
|
||||||
|
|
||||||
accept_confirm(confirmation) { click_button "Delete" }
|
accept_confirm(confirmation) { click_button "Delete" }
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ describe "Users" do
|
|||||||
fill_in "Email", with: "manuela@consul.dev"
|
fill_in "Email", with: "manuela@consul.dev"
|
||||||
click_button "Send instructions"
|
click_button "Send instructions"
|
||||||
|
|
||||||
expect(page).to have_content "If your email address is in our database, in a few minutes "\
|
expect(page).to have_content "If your email address is in our database, in a few minutes " \
|
||||||
"you will receive a link to use to reset your password."
|
"you will receive a link to use to reset your password."
|
||||||
|
|
||||||
action_mailer = ActionMailer::Base.deliveries.last.body.to_s
|
action_mailer = ActionMailer::Base.deliveries.last.body.to_s
|
||||||
@@ -633,7 +633,7 @@ describe "Users" do
|
|||||||
fill_in "Email", with: "fake@mail.dev"
|
fill_in "Email", with: "fake@mail.dev"
|
||||||
click_button "Send instructions"
|
click_button "Send instructions"
|
||||||
|
|
||||||
expect(page).to have_content "If your email address is in our database, in a few minutes "\
|
expect(page).to have_content "If your email address is in our database, in a few minutes " \
|
||||||
"you will receive a link to use to reset your password."
|
"you will receive a link to use to reset your password."
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -648,7 +648,7 @@ describe "Users" do
|
|||||||
fill_in "Email", with: "manuela@consul.dev"
|
fill_in "Email", with: "manuela@consul.dev"
|
||||||
click_button "Re-send instructions"
|
click_button "Re-send instructions"
|
||||||
|
|
||||||
expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\
|
expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \
|
||||||
"receive an email with instructions on how to confirm your email address."
|
"receive an email with instructions on how to confirm your email address."
|
||||||
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
||||||
expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"])
|
expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"])
|
||||||
@@ -664,7 +664,7 @@ describe "Users" do
|
|||||||
fill_in "Email", with: "fake@mail.dev"
|
fill_in "Email", with: "fake@mail.dev"
|
||||||
click_button "Re-send instructions"
|
click_button "Re-send instructions"
|
||||||
|
|
||||||
expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\
|
expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \
|
||||||
"receive an email with instructions on how to confirm your email address."
|
"receive an email with instructions on how to confirm your email address."
|
||||||
expect(ActionMailer::Base.deliveries.count).to eq(0)
|
expect(ActionMailer::Base.deliveries.count).to eq(0)
|
||||||
end
|
end
|
||||||
@@ -680,7 +680,7 @@ describe "Users" do
|
|||||||
fill_in "user_email", with: "manuela@consul.dev"
|
fill_in "user_email", with: "manuela@consul.dev"
|
||||||
click_button "Re-send instructions"
|
click_button "Re-send instructions"
|
||||||
|
|
||||||
expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\
|
expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \
|
||||||
"receive an email with instructions on how to confirm your email address."
|
"receive an email with instructions on how to confirm your email address."
|
||||||
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
||||||
expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"])
|
expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"])
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ describe "Verify Letter" do
|
|||||||
|
|
||||||
click_link "Send me a letter with the code"
|
click_link "Send me a letter with the code"
|
||||||
|
|
||||||
expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days"\
|
expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days" \
|
||||||
" we will send it to the address featuring in the data we have on file."
|
" we will send it to the address featuring in the data we have on file."
|
||||||
|
|
||||||
user.reload
|
user.reload
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ describe "Level three verification" do
|
|||||||
|
|
||||||
click_link "Send me a letter with the code"
|
click_link "Send me a letter with the code"
|
||||||
|
|
||||||
expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes)."\
|
expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes)." \
|
||||||
" In a few days we will send it to the address featuring in the data we have on file."
|
" In a few days we will send it to the address featuring in the data we have on file."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user