Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venshop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huanvl
venshop
Commits
476f0511
Commit
476f0511
authored
Nov 01, 2013
by
vulehuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rspec: card - remove a product in card - recalculted total cost
parent
973f4051
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
venshop_app/spec/requests/card_pages_spec.rb
+13
-13
No files found.
venshop_app/spec/requests/card_pages_spec.rb
View file @
476f0511
...
@@ -114,21 +114,21 @@ describe "CardPages" do
...
@@ -114,21 +114,21 @@ describe "CardPages" do
describe
"when product exist in card"
do
describe
"when product exist in card"
do
# it "calculate price" do
describe
"total price must be recalculated"
do
# product = Product.first
let
(
:product
)
{
Product
.
first
}
total
=
0
# total = 0
# # Add to cart all
# Product.all.each do |obj|
# visit cards_path(product_id: product.id)
# total += obj.price
# end
# visit cards_path(card_action: 'remove', product_id: product.id)
# total -= product.price
before
do
visit
cards_path
(
card_action:
'remove'
,
product_id:
product
.
id
)
total
=
0
Product
.
all
.
each
do
|
obj
|
total
+=
obj
.
price
end
total
-=
product
.
price
end
# page.should have_selector('#card-must-paid', text: ActionController::Base.helpers.number_with_delimiter(total + 1))
it
{
should
have_selector
(
'#card-must-paid'
,
text:
ActionController
::
Base
.
helpers
.
number_with_delimiter
(
total
))
}
#
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment