Merge pull request #3483 from consul/backport-fix_respond_with_bip
Fix obsolete `respond_with_bip` usage
This commit is contained in:
@@ -35,10 +35,10 @@ class Dashboard::PollsController < Dashboard::BaseController
|
|||||||
if poll.update(poll_params)
|
if poll.update(poll_params)
|
||||||
format.html { redirect_to proposal_dashboard_polls_path(proposal),
|
format.html { redirect_to proposal_dashboard_polls_path(proposal),
|
||||||
notice: t("flash.actions.update.poll") }
|
notice: t("flash.actions.update.poll") }
|
||||||
format.json { respond_with_bip(poll) }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.html { render :edit }
|
format.html { render :edit }
|
||||||
format.json { respond_with_bip(poll) }
|
format.json { render json: poll.errors.full_messages, status: :unprocessable_entity }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -197,6 +197,19 @@ feature "Polls" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Enable and disable results", :js do
|
||||||
|
create(:poll, related: proposal)
|
||||||
|
|
||||||
|
visit proposal_dashboard_polls_path(proposal)
|
||||||
|
check "Show results"
|
||||||
|
|
||||||
|
expect(find_field("Show results")).to be_checked
|
||||||
|
|
||||||
|
uncheck "Show results"
|
||||||
|
|
||||||
|
expect(find_field("Show results")).not_to be_checked
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Poll card" do
|
scenario "Poll card" do
|
||||||
poll = create(:poll, :expired, related: proposal)
|
poll = create(:poll, :expired, related: proposal)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user