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

Document how to stub route helper functions in isolated tests. Addresses... #513

Merged
merged 2 commits into from Apr 5, 2013
Merged

Document how to stub route helper functions in isolated tests. Addresses... #513

merged 2 commits into from Apr 5, 2013

Conversation

carols10cents
Copy link
Contributor

... #506.

See the discussion in #506 about the issue this is addressing.

I'm happy to revise this however to best fit into the existing documentation. I'm also not entirely clear if this is a minitest specific thing or if it affects rspec as well. I'd also be fine with changing from mocha's stubs in the example to rspec's stub if readers of this documentation are more likely to be familiar with rspec's stubbing stuff.

I'm also cool with moving this to the wiki somewhere if this doesn't belong in the README.

Basically tell me how to change this and i'll be glad to do it :)

helpers.stubs(users_path: '/users')
```


Copy link
Member

Choose a reason for hiding this comment

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

✂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're saying to cut the extra newline, correct? Just want to check my emoji interpretation :) 🌵 🎩

Copy link
Member

Choose a reason for hiding this comment

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

cccc

@steveklabnik
Copy link
Member

Seems great with those two minor edits. ❤️ ❤️ 💖

@haines
Copy link
Contributor

haines commented Apr 5, 2013

It should be noted that the include Draper::ViewHelpers is only necessary if you are using minitest's spec syntax without minitest-rails. If you're using RSpec, minitest-rails, or the standard test-unit syntax, the include isn't needed (in these cases you are inheriting from Draper::TestCase which already includes the module).

@haines
Copy link
Contributor

haines commented Apr 5, 2013

I'd also be fine with changing from mocha's stubs in the example to rspec's stub

👍 I think it would be better to use RSpec's syntax here, not that it makes much difference :)

* Get rid of an unnecessary newline
* Change 'include Rails' to 'require Rails'
* Clarify when you would need to explicitly include ViewHelpers
* Switch from mocha `stubs` to RSpec `stub`
@haines
Copy link
Contributor

haines commented Apr 5, 2013

👍 ❤️

steveklabnik added a commit that referenced this pull request Apr 5, 2013
Document how to stub route helper functions in isolated tests. Addresses...
@steveklabnik steveklabnik merged commit e20604a into drapergem:master Apr 5, 2013
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