Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
AO3-5138 Prevent 500 error when admin post's translated_post_id is invalid #3021
Conversation
sarken
added some commits
Aug 30, 2017
sarken
added
the
Awaiting review
label
Aug 30, 2017
| @@ -1,6 +1,7 @@ | ||
| class AdminPostsController < ApplicationController | ||
| before_action :admin_only, except: [:index, :show] | ||
| + before_action :load_languages, except: [:show, :destroy] |
| click_button("Post") | ||
| end | ||
| +Then (/^the translation information should still be filled in$/) do |
| @@ -0,0 +1,30 @@ | ||
| +require "spec_helper" |
| + describe "POST #create" do | ||
| + before { fake_login_admin(create(:admin)) } | ||
| + | ||
| + let(:base_params) { { title: "AdminPost Title", |
houndci-bot
Aug 30, 2017
Avoid using {...} for multi-line blocks.
Block body expression is on the same line as the block start.
| + before { fake_login_admin(create(:admin)) } | ||
| + | ||
| + let(:base_params) { { title: "AdminPost Title", | ||
| + content: "AdminPost content long enough to pass validation" } } |
elzj
merged commit 4bf661a
into
otwcode:master
Aug 30, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sarken commentedAug 30, 2017
Issue
https://otwarchive.atlassian.net/browse/AO3-5138
Purpose
Makes sure admin post languages are properly loaded for all actions that need it, thereby preventing a 500 error that would occur when trying to create an admin post with an invalid translated_post_id.
I realized the specs didn't actually cover the proper scenario, but I left them in because why not.
Testing
See JIRA