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
<a title="شات" href="http://www.y222y.com">شات</a>
<a title="منتديات عذاري" href="http://vb.y222y.com">منتديات عذاري</a>
<a title="دردشة الشلة" href="http://dlil.y222y.com/y222y-14065.html">دردشة الشلة</a>
<a title="دردشة دلع نجد" href="http://dlil.y222y.com/y222y-14066.html">دردشة دلع نجد</a>
<a title="دردشة البحرين" href="http://dlil.y222y.com/y222y-14072.html">دردشة البحرين</a>
<a title="دردشة روحي تحبك" href="http://dlil.y222y.com/y222y-14062.html">دردشة روحي تحبك</a>
<a title="دردشة المميزة" href="http://dlil.y222y.com/y222y-14059.html">دردشة المميزة</a>
<a title="دردشة الغلا" href="http://dlil.y222y.com/y222y-14063.html">دردشة الغلا</a>
<a title="شات تعب قلبي" href="http://dlil.y222y.com/y222y-14068.html">شات تعب قلبي</a>
<a title="شات روحي تحبك" href="http://dlil.y222y.com/y222y-14061.html">شات روحي تحبك</a>
<a title="دردشة بنت الاردن" href="http://dlil.y222y.com/y222y-14055.html">دردشة بنت الاردن</a>
<a title="شات تحب" href="http://dlil.y222y.com/y222y-14024.html">شات تحب</a>
<a title="دردشة اللوبي السعودي" href="http://dlil.y222y.com/y222y-14041.html">دردشة اللوبي السعودي</a>
<a title="شات المميزة" href="http://dlil.y222y.com/y222y-14060.html">شات المميزة</a>
<a title="دردشة شلة بنات" href="http://dlil.y222y.com/y222y-13477.html">دردشة شلة بنات</a>
<a title="دردشة الشرقية" href="http://dlil.y222y.com/y222y-13476.html">دردشة الشرقية</a>
<a title="دردشة بنات القطيف" href="http://dlil.y222y.com/y222y-13364.html">دردشة بنات القطيف</a>
<a title="دردشة قلبي" href="http://dlil.y222y.com/y222y-13687.html">دردشة قلبي</a>
<a title="دردشة احساس" href="http://dlil.y222y.com/y222y-12824.html">دردشة احساس</a>
<a title="دردشة القصيم" href="http://dlil.y222y.com/y222y-12806.html">دردشة القصيم</a>
<a title="دردشة علي بابا" href="http://dlil.y222y.com/y222y-12717.html">دردشة علي بابا</a>
<a title="دردشة دلع الكويت" href="http://dlil.y222y.com/y222y-14067.html">دردشة دلع الكويت</a>
<a title="دردشة تعب قلبي" href="http://dlil.y222y.com/y222y-5354.html">دردشة تعب قلبي</a>
<a title="دردشة كازنوفا" href="http://dlil.y222y.com/y222y-14069.html">دردشة كازنوفا</a>
<a title="دليل دردشات" href="http://dlil.y222y.com">دليل دردشات</a>
<a title="رقص بنت السعوديه" href="http://dlil.y222y.com/y222y-14129.html">رقص بنت السعوديه</a>
<a title="رقص فضيحة" href="http://dlil.y222y.com/y222y-14138.html">رقص فضيحة</a>
<a title="رقص بنات" href="http://dlil.y222y.com/y222y-14136.html">رقص بنات</a>
<a title="رقص مصري" href="http://dlil.y222y.com/y222y-14130.html">رقص مصري</a>
<a title="دردشة كويتية" href="http://dlil.y222y.com/cat-y222y-73.html">دردشة كويتية</a>
<a title="دردشة عربية" href="http://dlil.y222y.com/cat-y222y-72.html">دردشة عربية</a>
<a title="دردشة سعودية" href="http://dlil.y222y.com/cat-y222y-71.html">دردشة سعودية</a>
<a title="دردشة خليجية" href="http://dlil.y222y.com/cat-y222y-70.html">دردشة خليجية</a>
<a title="بلوتوث" href="http://dlil.y222y.com/cat-y222y-60.html">بلوتوث</a>
<a title="دردشة كتابية" href="http://dlil.y222y.com/cat-y222y-13.html">دردشة كتابية</a>
<a title="ازياء" href="http://vb.y222y.com/f2.html">ازياء</a>
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.
It is very good.I like to see it.I will try it.Thank you .Have a good time.







