Onur Özgür ÖZKAN
2011-Aug-16 20:10 UTC
Couldn''t access /test/fixtures/namespaces/users.yml on test/unit/namescapes/user_test.rb
Hi Guys,
First post on group :). My problem is i couldn''t access the test
fixtures on
unit test class with using namespaces.
My fixtures at */test/fixtures/kebab/users.yml*
----------------
onur:
user_name: onur.ozgur.ozkan
email: onur.ozgur.ozkan-QnCSCsRl1hBBDgjK7y7TUQ@public.gmane.org
password: 123456
----------------
My unit test at *test/unit/kebab/user_test.rb*
----------------
require ''test_helper''
class Kebab::UserTest < ActiveSupport::TestCase
* fixtures ''kebab/users''*
test "user is not valid without a unique user_name" do
user = Kebab::User.new(
*:user_name => users(:onur).user_name,*
:email =>
''test-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'',
:password => ''password''
)
assert !user.save
assert_equal "has already been taken",
user.errors[:user_name].join('';
'')
end
end
-------------------
When i run test i get
--------------------------
NoMethodError: undefined method `users'' for
#<Kebab::UserTest:0xb692c1e0>
test/unit/kebab/user_test.rb:15:in
`test_user_is_not_valid_without_a_unique_user_name''
--------------------------
How can i access the fixtures data at user_test.rb?
Best regards.
--
*
*
*Onur Özgür ÖZKAN*
***lab2023 - internet teknolojileri*
www.lab2023.com
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.