나는 이것이 새로운 Rails 사용자이고 오이를 올바르게하고 싶어서 기본이라고 확신합니다. 나는 주말에 Pragmatic 책을 읽으며 작은 프로젝트를 만들어서 그것을 만들고 사용하고 싶다. 의도적으로 가능한 한 광범위하게 첫 번째 기능을 설정하여 레일 측면에서 작동하는 방식에 따라 너무 부서지기 쉽지 않습니다. DanielKehoe의 github 시동기를 사용하여 새로운 레일 앱을 만들었습니다. 나는 사용자를 알아 냈다고 생각한다. 그러나 내가 오이를 사용하여 상수의 테이블이 될 참조 단위의 첫 번째 테이블을 만들려고 할 때 나는 오이가 나를 참조 단위 모델로 만들 것이라고 예상했지만 나는 아침마다 그것을 사용하여 그렇게하도록했습니다. 책, Railscasts 및 stackoverflow 내가 지금 어디로 나를 밀어. 나는 앞으로 나아가서 참조 단위 (Reference Units)를위한 모델, 새로운 액션과 빈 뷰 (empty view)를 가진 컨트롤러를 생성했다. 하지만 이제는 (LoadError)가있는 참조 단위 모델이 있다는 것을 알 수 없습니다. 이상한 것은 앱에 있기 때문입니다.오이 (LoadError) 내 모델
:when /the new Reference Units page/ '/reference_units/new'
Given /^I am logged in as the following user:$/ do |table|
sign_up valid_user
end
When /^I go to the new Reference Units page$/ do
visit new_reference_unit_path
end
When /^I fill in the following:$/ do |table|
@reference_unit = Reference_unit.create!(table.rows_hash)
end
Then /^it should create a new Reference Unit$/ do
pending # express the regexp above with the code you wish you had
end
new_reference_unit_path는 나의 기능/지원/paths.rb에 : 여기
Feature: I want to have Reference Units that I can refer to so they can be used elsewhere. That way
they can be updated in one place. I want to create and edit these Units.
Background:
Given I am logged in as the following user:
| name | "Testy McUserton" |
| password | "please" |
| email | "[email protected]" |
Scenario: Adding Reference Units
When I go to the new Reference Units page
And I fill in the following:
| commodity | "corn" |
| language | "en" |
| wholesale unit | "xton" |
| retail unit | "xliter" |
| receipt unit | "dollar" |
Then it should create a new Reference Unit
내 단계 정의입니다 :
여기에 내 현재 기능입니다
실행 3.1.3에서 다음을 적색으로 표시합니다.
Scenario: Adding Reference Units # features/user_can_create_units.feature:10
When I go to the new Reference Units page # features/step_definitions/user_create_unit_reference.rb:6
Expected /Users/sam/apps/keriakoo/app/models/reference_unit.rb to define Reference_unit (LoadError)
./app/controllers/reference_units_controller.rb:4:in `new'
./features/step_definitions/user_create_unit_reference.rb:7:in `/^I go to the new Reference Units page$/'
features/user_can_create_units.feature:11:in `When I go to the new Reference Units page'
위에서 언급 한 것과 같습니다. reference_unit.rb 파일이 올바른 위치에 있습니다. 물론, 오이가 나를 올바른 시간에 인도 할 것으로 기대하는 어떠한 방법이나 속성도 추가하지 않았습니다. 나는 그것이 단순한 것이라고 확신하지만, 모든 종류의 단어와 대문자 조합을 사용하여 느슨한 것을 흔들어 보았습니다.