-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
spec/features/admin/prevent_update_future_reserved_lunchbox_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.feature '未来日に予約されている弁当の更新を行う時にエラーにする', type: :feature do | ||
given!(:order) { create(:order, date: Time.zone.local(2017, 2, 4)) } | ||
given!(:lunchbox) { create(:lunchbox) } | ||
|
||
scenario '未来日に予約を入れた状態で、その弁当を更新する' do | ||
Timecop.freeze(Time.zone.local(2017, 2, 1)) do | ||
create(:order_item, lunchbox_id: lunchbox.id, order: order) | ||
|
||
visit edit_admin_lunchbox_path(lunchbox) | ||
|
||
fill_in 'Name', with: "new_lunchbox_name" | ||
|
||
click_button('Update Lunchbox') | ||
|
||
expect(page).to have_text('未来日に予約された弁当は更新できません') | ||
# expect(page).not_to have_text('new_lunchbox_name') | ||
end | ||
end | ||
end |