-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Replace all uses of wiki.slug in favor of wiki.path, fixes #736 #1101
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class TalkController < ApplicationController | ||
def show | ||
@node = DrupalNode.find_by_slug params[:id] | ||
@node = DrupalNode.find_by_path params[:id] | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div><p class="help-text" style="margin-top: 10px;font-family: 'Junction Light';clear:left;"><%= raw t('talk.show.welcome', :page => @node.latest.title, :url1 => @node.path, :url2 => '/wiki/talk-pages') %></p></div> | ||
<div><iframe src="https://pad.publiclab.org/p/<%= @node.slug[0,50] %>" style="width: 100%; height:800px;"><p><%= t('talk.show.try_direct_link', :url1 => 'https://pad.publiclab.org/p/'+@node.slug[0,50]) %></p></iframe></div> | ||
<div><iframe src="https://pad.publiclab.org/p/<%= @revision.drupal_node.slug_from_path[0,50] %>" style="width: 100%; height:800px;"><p><%= t('talk.show.try_direct_link', :url1 => 'https://pad.publiclab.org/p/'+@revision.drupal_node.slug_from_path[0,50]) %></p></iframe></div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,7 +321,7 @@ def teardown | |
assert_equal 0, revision.status | ||
assert_equal 0, revision.author.status | ||
assert_not_equal node(:spam_targeted_page).latest.vid, revision.vid | ||
assert_redirected_to "/wiki/revisions/<%= @node.slug %>" + '?_=' + Time.now.to_i.to_s | ||
assert_redirected_to "/wiki/revisions/" + @revision.drupal_node.slug_from_path + '?_=' + Time.now.to_i.to_s | ||
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. OK -- while in the controller, we used an instance variable (starting with |
||
end | ||
|
||
test "admin user should be able to republish a revision" do | ||
|
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.
Yes -- see how here, we can indeed use
@node
-- it was only in some contexts where@revision
was required, not all. Thanks!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.
I went through the errors. @node is fine for all except admin_controller.rb and admin_controller_test.rb.
What should I use in admin_controller.rb and admin_controller_test.rb??
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.
Is there any way of testing a part of code and not the whole code locally? Some command instead of rake test:all .
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.
On this line in the admin controller test,
revision.drupal_node
:https://github.com/publiclab/plots2/blob/master/test/functional/admin_controller_test.rb#L324
And on this line,
@revision.drupal_node
:https://github.com/publiclab/plots2/blob/master/app/controllers/admin_controller.rb#L150
Yes, you can run just functional tests with
rake test:functionals
, units withrake test:units
, integration withrake test:integration
, and you can even run just one test file with:ruby -I test test/functional/notes_controller_test.rb
(for example)I know it's time consuming to run them all!
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.
Okay I will work on it now!