Do you do any testing with shoulda? after banging my head over rspec for the past few days i decided to give it a try but there is not much instruction out there. I bet this cast would have gotten me stick with rspec for a few more days if id seen it earlier. :-p
It should probably be noted that it's not ideal to just get every passed in action in the last macro. Instead, one might use something like the following:
http://gist.github.com/94405
Good stuff. :) The RSpec RDoc on matchers is very confusing but your screencast is very easy to understand.
Awesome, custom rspec matchers for Moonshine are in my backlog. You just saved me a lot of time :).
Does your it_should_require_admin_for_actions test what you want it to?
In articles_controller_spec.rb, you wrote out 5 it blocks that test the actions using get, post, put, and delete, but it_should_require_admin_for_actions only runs get on each of the actions. Doesn't it need to run the correct verb on each action, or does it work the way it is?
@Clemens, @erik, good eye, and thank you for pointing this out. I have not found any downside to using "get" at all times for testing this authentication before filter. However the solution Clements gave seems like a great way to handle this issue.
As a new person to tests and RSpec I have a problem getting my head around one thing:
How do the tests you write get integrated back into the code of the application? And how do methods like login_as_admin get used in the application?
If I'm writing code to make tests easier, shouldn't that code also make coding the application easier?
As always awesome reailscast.
I'm going into Rspec+Cucumber and so on right now and those last episodes are really useful.
Hope you are going to make some more on the topic.
Have a good 1 buddy.
As usual another great screencast, thanks Ryan.
I am especially enjoying all your recent screencasts dedicated to testing as I felt I needed some extra help on this often underestimated aspect of programming.
I really appreciate your work. It helps me to improve my skills in Rails. Thanks a lot.
At 3:07 on line 5 in the block 'action' changes to 'actual' - don't really see this as a problem, was just weird - thought I was seeing things till I wound it back.
Great episode as usual.
I'm a little foggy on why it_should_require_admin_for_actions needs to be a class method. Is it because you're using it to generate it-blocks?
As a new person to tests and RSpec I have a problem getting my head around one thing:
How do the tests you write get integrated back into the code of the application? And how do methods like login_as_admin get used in the application?
As always awesome reailscast.
I'm going into Rspec+Cucumber and so on right now and those last episodes are really useful.
Hope you are going to make some more on the topic.
Have a good 1 buddy.
Don`t understand what do this code
it "#{action} action should require admin" do
get action, :id => 1
Thanks! Recently I've been reading the RSpec beta book from Pragmatic Programmers, and it was not too much clear for me. Now I think I've finally understood how this works.
Thanks! Recently I've been reading the RSpec beta book from Pragmatic Programmers, and it was not too much clear for me. Now I th
www.t-bahlme.com
منتديات جديد الورد برعايه عنتر الوادعي
research on this subject for a school project and your article is really useful
Awesome, custom rspec matchers for Moonshine are in my backlog. Great informative post thanks for sharing. I really appreciate what you post. If only i could think of a plugin to actually write. I will instantly grab your rss feed to stay informed of any updates.
The dissertation chapters should be perfectly composed by distinguished thesis service, when people want to present a writing talent. Thus, this is manifestly that you understand the right way to finish a superb issue referring to this topic. Thank you very much for distributing this.
I have always liked Outdoor movies, a child standing at the window, looked out from home to the following. Will be able to see the staff busy figure, a huge white cloth has a child hang up and soon will be able to see the movie.
I really appreciate what you post. If only i could think of a plugin to actually write. I will instantly grab your rss feed to stay informed of any updates. thank you very much!!
Discount Wholesale Electronics, Wholesale Cell Phones, Electronic Gadgets and More from the Best Dropship Wholesaler
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
Awesome, custom rspec matchers for Moonshine are in my backlog. You just saved me a lot of time :).
Good article! Thank you so much for sharing this post.Your views truly open my mind.






