Skip to content

Commit

Permalink
Merge pull request #59 from colorbox/51-japanesize
Browse files Browse the repository at this point in the history
51 文言の日本語化
  • Loading branch information
yucao24hours committed Mar 23, 2017
2 parents 9488bd7 + f29bc92 commit 65c53b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/order_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create
@order_item = @order.order_items.build(order_item_params)

if @order_item.save
redirect_to order_order_items_path(@order) , notice: 'Order item was successfully created.'
redirect_to order_order_items_path(@order) , notice: '注文しました'
else
render :new
end
Expand All @@ -39,7 +39,7 @@ def update
def destroy
@order_item.destroy
if @order_item
notice = "#{@order_item.customer_name}'s' #{@order_item.lunchbox.name} item was successfully deleted."
notice = "#{@order_item.customer_name} さんの #{@order_item.lunchbox.name} の注文を取り消しました。"
redirect_to order_order_items_path(@order_item.order) , notice: notice
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/order_items/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ table(border=1)
td.name(align="center") = "✓"
- else
td.name = ""
td.name = link_to "cancel", order_order_item_path(@order, item), method: :delete, data: {confirm: 'Are you certain you want to delete this?'}
td.name = link_to '予約取り消し', order_order_item_path(@order, item), method: :delete, data: {confirm: 'この注文を取り消しますか?'}

6 changes: 3 additions & 3 deletions spec/features/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@

visit order_order_items_path(order)
expect(page).to have_text(order_item.customer_name)
expect(page).to have_text('cancel')
expect(page).to have_text('予約取り消し')

click_link('cancel')
click_link('予約取り消し')
expect(page).not_to have_text(order_item.customer_name)
end

Expand All @@ -62,7 +62,7 @@
visit order_order_items_path(order)

expect(page).to have_text(order_item.customer_name)
expect(page).not_to have_link('cancel')
expect(page).not_to have_link('予約取り消し')
end
end

Expand Down

0 comments on commit 65c53b2

Please sign in to comment.