1
나는 오이를 늘리고 있으며, 첫 번째 테스트 중 하나를 통과하는 데 문제가 있습니다. 나는 점점 오전 예외는 다음과 같습니다레일 | 오이 | acl9 | AccessDenied
여기And I visit the new contract screen
Acl9::AccessDenied (Acl9::AccessDenied)
/usr/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
(eval):2:in `visit'
./features/step_definitions/manage_contracts_steps.rb:2:in `/^I visit the (.*) screen$/'
features/manage_contracts.feature:15:in `And I visit the new contract screen'
내 오이 기능입니다 ...
이Background:
Given the following user records
| login | password | name | role |
| bob | secret | Bob | 'PSCM Staff' |
| admin | secret | Frank| admin |
@new
Scenario: Create Contract
When I log in as "bob" with password "secret"
And I visit the new contract screen
Then I should see "Contract Name"
내 steps.rb :
Given /^the following user records$/ do |table|
table.hashes.each do |hash|
role = hash.delete('role')
u = Factory(:user, hash)
u.has_role!(role) if role
end
end
When /^I visit the (.*) screen$/ do |screen|
visit path_to(screen)
end
마지막으로 내 controller.rb에 나는이 다음 access_control 블록을 참조하십시오.
브라우저에서 명시 적으로 단계를 수행하면 senario가 올바르게 작동합니다.
죄송합니다. 긴 게시물을 보내 주셔서 감사합니다.