Thanks, 

Now I have to find a good example of a rspec 3.0 where  I can test 
responds_to.
I found a example but that one does not work. 

Roelof


Op vrijdag 8 augustus 2014 18:39:57 UTC+2 schreef Myron Marston:

> On Friday, August 8, 2014 9:25:19 AM UTC-7, Roelof Wobben wrote:
>>
>> Hello, 
>>
>> I have made this file into spec/models/admin_users.rb 
>>
>> require 'rails_helper'
>>  
>> RSpec.describe Admin, type: :model do
>>  
>> def build_valid_user(opts = {})
>> valid_opts = {
>> name: "Example adminUser",
>> email: "[email protected] <javascript:>",
>> password: "foobar",
>> password_confirmation: "foobar",
>> }
>> User.new valid_opts.merge(opts)
>> end
>>  
>> it { should respond_to(:name) }
>> it { should respond_to(:password) }
>>  
>> context "given a valid user" do
>> subject(:any_valid_user) { build_valid_user }
>>  
>> it { should be_valid }
>> end
>>
>> but when I do rspec spec/  I see this output: 
>>
>>
>> No examples found.                                                           
>>                                                                              
>>                                                                              
>>                                           
>>
>>                                                                              
>>                                                                              
>>                                                                              
>>                                           
>>
>>                                                                              
>>                                                                              
>>                                                                              
>>                                           
>>
>> Finished in 0.00023 seconds (files took 0.07842 seconds to load)             
>>                                                                              
>>                                                                              
>>                                           
>> 0 examples, 0 failures                                             
>>
>> Roelof
>>
>
> Your file name (spec/models/admin_users.rb) doesn't match the default 
> value of the `pattern` option:
>
>
> https://relishapp.com/rspec/rspec-core/v/3-0/docs/command-line/pattern-option
>
> Rename your file to `spec/models/admin_users_spec.rb` and it should work. 
>  If you'd like to use an alternate pattern, you can choose a different 
> value for the `--pattern` option and put it in `.rspec`.
>
> Myron
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/103b83c0-059a-4446-987d-8e17352bdac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to