2013.08.19 Monday
スポンサーサイト
一定期間更新がないため広告を表示しています
| - | | - | -
def new @user = User.find(params[:user_id])
@message = @user.messages.build
end
def create
@user = User.find(params[:user_id])
@message = @user.messages.new(params[:message])
if @message.save
flash[:notice] = 'Message saved'
redirect_to user_url(@user)
else
render :action => "new" # Here is the problem I guess
end
end
<% form_for [@user, @message] do |f| %>
<%= f.error_messages %>
Name:<%= f.text_field :name %>
Email:<%= f.text_field :email %>
Message:<%= f.text_area :body, :rows => 3 %>
<%= f.submit 'Send' %>
<% end %>
Given I am on the new moso page # features/manage_mosos.feature:7
Ambiguous match of "I am on the new object page":
features/step_definitions/moso_steps.rb:1:in `/^(?:|I )am on (.+)$/'
features/step_definitions/web_steps.rb:44:in `/^(?:|I )am on (.+)$/'
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
features/manage_mosos.feature:7:in `Given I am on the new moso page'
And I press "Create" # features/manage_mosos.feature:10
Ambiguous match of "I press "Create"":
features/step_definitions/moso_steps.rb:9:in `/^I press "([^"]*)"$/'
features/step_definitions/web_steps.rb:52:in `/^(?:|I )press "([^"]*)"$/'
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
features/manage_mosos.feature:10:in `And I press "Create"'
評価:
David Thomas,Andrew Hunt Addison-Wesley Pub (Sd) ¥ 3,634 (2000-12-15) |