rails3 어플리케이션에서 단위 테스트를 구현하려고합니다. 다음은 내 'test_helper.rb
'파일입니다. 내 고정 파일 다음레일 3의 단위 테스트 오류
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
include Devise::TestHelpers
fixtures :all
end
(site_layouts.yml
)
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
name: layout1
content: <html><head></head><body>layout1</body></html>
two:
name: layout2
content: <html><head></head><body>layout2</body></html>
및 다음 내 단위 테스트 클래스
require 'test_helper'
class SiteLayoutTest < Test::Unit::TestCase
fixtures :site_layouts
test "show site layout" do
layout = site_layouts(:one)
end
end
와 나는 rake test:units
을 실행하려고 할 때 다음과 같은 오류를 얻고있다
undefined method `fixtures' for SiteLayoutTest:Class (NoMethodError)
나는 약간 새로운 테스트를합니다. 난
- 레일 3.0.0
- 리눅스
- 시험 단위 (2.4.1, 2.4.0, 2.3.2, 1.2.3)
- (시험 단위에 통지에 0.3.0)
감사합니다. ream88, 맞습니다. – sameera207