Cucumber 1.1.4を初めて使用して小さなアプリを起動し、「不明な属性」というエラーが表示されてエラーが表示されます。私はレコードが存在することを確認したい、そうでなければ作成する。私はショーページがerbコールで存在し、レコードが存在することを確かめました。ここでRails 3、cucumber "unknown attribute"
は私の機能です:
Scenario: normal Given an opening exists called "jobid", objective: "Work here", grizzard: "My experience", skills: "My skills" When I go to the path "/openings/jobname" Then I should see "Sam Walton" Then I should see "Work here" Then I should see "My experience" Then I should see "My skills"
はここに私のステップのファイルがあります:
Given /^an opening exists called "([^"]*)", objective: "([^"]*)", bob: "([^"]*)", skills: "([^"]*)"$/ do
|opening_name, objective_text, bob_text, skills_text|
Opening.create!(name: opening_name, objective: objective_text, skills: skills_text, grizzard: bob_text)
end
When /^I go to the path "([^"]*)"$/ do |path|
visit(path)
end
Then /^I should see "([^"]*)"$/ do |text|
page.should have_content(text)
end
ここに私のエラーです:
# features/visitor_can_view_an_opening.feature:6
Given an opening exists called "jobid", objective: "Work here", grizzard: "My experience", skills: "My skills" #
features/step_definitions/general_steps.rb:5
unknown attribute: skills (ActiveRecord::UnknownAttributeError)
./features/step_definitions/general_steps.rb:6:in/^an opening exists called "([^"]*)", objective: "([^"]*)", bob: "([^"]*)", skills: "([^"]*)"$/
features/visitor_can_view_an_opening.feature:7:inGiven an opening exists called "jobid", objective: "Work here", bob: "My experience", skills: "My skills"
私はスキルの上に見てきた:それはのように見えます他の人は、私の経験がないので、私が理解していないことを指摘してくれる人に感謝します。サム
オープニングテーブルにスキルの列がありますか? – socjopata
はい、私は開発データベースのスペルを二重にチェックしました。チェックのthx。 – sam452
はい、ただし、この列をテストDBにも置く必要があります。 – socjopata