-
Notifications
You must be signed in to change notification settings - Fork 3
Fix app and spec errors #65
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
Conversation
@@ -17,7 +17,7 @@ def show | |||
|
|||
render json: JSON.pretty_generate(results) | |||
else | |||
redirect_to new_submissions_path | |||
redirect_to new_submission_path |
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.
Correcting route name.
get :show | ||
expect(response).to have_http_status(:success) | ||
expect(response).to have_http_status(:redirect) |
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.
The controller action throws a redirect, so now the spec checks for that.
@@ -4,7 +4,7 @@ | |||
describe 'GET /submissions' do | |||
it 'works! (now write some real specs)' do | |||
get submissions_path | |||
expect(response).to have_http_status(:ok) | |||
expect(response).to have_http_status(:redirect) |
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.
Same as above: controller action throws a redirect.
@@ -3,7 +3,6 @@ | |||
RSpec.describe 'submissions/new', type: :view do | |||
before do | |||
assign(:submission, Submission.new( | |||
url: 'MyText', |
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.
The Submission
model doesn't have a url
field on it, so this was throwing an error.
assert_select 'textarea[name=?]', 'submission[html]' | ||
|
||
assert_select 'textarea[name=?]', 'submission[base_url]' | ||
assert_select 'input[name=?]', 'submission[base_url]' |
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.
Fixing spec to match page's markup.
assert_select 'input[name=?][value=?]', 'submission[base_url]', 'MyText' | ||
|
||
assert_select 'textarea[name=?]', 'submission[json]' | ||
end |
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.
This set of assertions is an improvement over the string matching (which was breaking). This is a quick fix, but I'm sure it could be improved.
While getting the app checked out and up-and-running, I found a handful of spec errors that would reasonably prevent moving forward with dependency updates.
So… this PR addresses those errors. I'll post comments alongside the changes for context. Feedback appreciated. Thanks!