Skip to content
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 a problem the before/after filters don't work when they are inserted after the target route in controller. #1555

Merged
merged 2 commits into from Jan 16, 2014

Conversation

namusyaka
Copy link
Contributor

The before/after filters don't work when they are inserted after the target route in controller.

Edge::App.controllers :test do
  get(:index){ @foo }
  before(:index){ @foo = "Hello World" }
end

get "/test/" #=> Expected: "Hello World", Actual: ""

should "should work only for the given controller and route when using before-filter with route's name." do
mock_app do
controller :foo do
before(:index) { @a = "only to :index" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To indicate the problem this should be 2 lines lower. Then without the patch it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for the reviewing. I'll change order of commits, and add a test about this problem.

@skade
Copy link
Contributor

skade commented Jan 16, 2014

This looks good to me.

skade added a commit that referenced this pull request Jan 16, 2014
Fix a problem the before/after filters don't work when they are inserted after the target route in controller.
@skade skade merged commit 6a99189 into master Jan 16, 2014
@namusyaka namusyaka deleted the fix-filters branch January 16, 2014 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants