Files
grecia/spec/support/common_actions.rb
Senén Rodero Rodríguez ac6260a2ef Mock remote census responses in tests using XML
By using real XML responses developers will be able to understand better
how the integration works (the data flow), and the correspondency between
`remote_census` settings and their place at a real XML response.

As `stubbed_responses` methods were removed from the model layer now the
stubbing part should be managed from the test environment code so also
added a new helper module `RemoteCensusSetup` that can be used anywhere
where we need to call the web service.

Co-Authored-By: Javi Martín <javim@elretirao.net>
2020-11-02 11:42:39 +01:00

47 lines
1.4 KiB
Ruby

Dir["./spec/support/common_actions/*.rb"].each { |f| require f }
module CommonActions
include Budgets
include Comments
include Debates
include Emails
include Notifications
include Polls
include Proposals
include RemoteCensusMock
include Tags
include Translations
include Users
include Verifications
include Votes
def fill_in_signup_form(email = "manuela@consul.dev", password = "judgementday")
fill_in "user_username", with: "Manuela Carmena #{rand(99999)}"
fill_in "user_email", with: email
fill_in "user_password", with: password
fill_in "user_password_confirmation", with: password
check "user_terms_of_service"
end
def validate_officer
allow_any_instance_of(Officing::BaseController).
to receive(:verify_officer_assignment).and_return(true)
end
def fill_in_proposal
fill_in "Proposal title", with: "Help refugees"
fill_in "Proposal summary", with: "In summary, what we want is..."
fill_in "Proposal text", with: "This is very important because..."
fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk"
fill_in "proposal_responsible_name", with: "Isabel Garcia"
check "proposal_terms_of_service"
end
def set_officing_booth(booth = nil)
booth = create(:poll_booth) if booth.blank?
allow_any_instance_of(Officing::BaseController).
to receive(:current_booth).and_return(booth)
end
end