forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix registering on conference #1220
Closed
Closed
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0952174
test:update conference registration system test
BarbaraOliveira13 3515950
test: add registration_types controller test
Stef-Rousset 9ca7dea
Merge branch 'test-controller-registration-types' into Fix/conference…
Stef-Rousset 10f2354
fix: conference registration_types controller index
Stef-Rousset 5a3bb1f
correction after PR review
Stef-Rousset 6f092fe
fix: hide register button in conference when no registration types (#…
Stef-Rousset 59804f1
fix: add has_published_registration_types? method to conference model
BarbaraOliveira13 42befd3
fix: add rspec for has_published_registration_types? method
BarbaraOliveira13 7d42432
lint: fix with rubocop
BarbaraOliveira13 7d34ea6
refacto
BarbaraOliveira13 6667e4d
fix: update views and system tests after change request
Stef-Rousset 9f0fcaf
fix: update system spec after review
Stef-Rousset cf08f85
fix: Add Change request suggestions
Quentinchampenois 6db1961
style: update context sentences in system test (#1223)
Stef-Rousset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
decidim-conferences/spec/controllers/registration_types_controller_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,59 @@ | ||||||
# frozen_string_literal: true | ||||||
|
||||||
require "spec_helper" | ||||||
|
||||||
module Decidim | ||||||
module Conferences | ||||||
describe RegistrationTypesController do | ||||||
routes { Decidim::Conferences::Engine.routes } | ||||||
|
||||||
let(:organization) { create(:organization) } | ||||||
let!(:conference) do | ||||||
create( | ||||||
:conference, | ||||||
:published, | ||||||
registrations_enabled:, | ||||||
organization: | ||||||
) | ||||||
end | ||||||
let(:registrations_enabled) { true } | ||||||
let(:registration_types_count) { 5 } | ||||||
let!(:registration_types) do | ||||||
create_list(:registration_type, registration_types_count, conference:) | ||||||
end | ||||||
let(:registration_type) { registration_types.first } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused variable |
||||||
|
||||||
before do | ||||||
request.env["decidim.current_organization"] = organization | ||||||
end | ||||||
|
||||||
describe "index" do | ||||||
context "when registration_types is present" do | ||||||
it "does not raise an error" do | ||||||
get :index, params: { conference_slug: conference.slug } | ||||||
assert_response :success | ||||||
end | ||||||
end | ||||||
|
||||||
context "when registration_types is empty" do | ||||||
let(:registration_types) { nil } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
context "and current_participatory_space registrations is enabled" do | ||||||
it "does raise an error" do | ||||||
expect { get :index, params: { conference_slug: conference.slug } } | ||||||
.to raise_error(ActionController::RoutingError) | ||||||
end | ||||||
end | ||||||
|
||||||
context "and current_participatory_space registrations is disabled" do | ||||||
let(:registrations_enabled) { false } | ||||||
|
||||||
it "does not raise an error" do | ||||||
get :index, params: { conference_slug: conference.slug } | ||||||
assert_response :success | ||||||
end | ||||||
end | ||||||
end | ||||||
end | ||||||
end | ||||||
end | ||||||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change the described class