Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
2a759485
Commit
2a759485
authored
Sep 26, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make up the remain mistake about catalog_ids in spec
parent
d8aa7e09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
product_spec.rb
...nerators/templates/spec/requests/customer/product_spec.rb
+5
-6
No files found.
lib/generators/templates/spec/requests/customer/product_spec.rb
View file @
2a759485
...
@@ -8,7 +8,7 @@ RSpec.describe "#{namespace}/products", type: :request, capture_examples: true,
...
@@ -8,7 +8,7 @@ RSpec.describe "#{namespace}/products", type: :request, capture_examples: true,
@products
=
create_list
(
:product
,
3
)
@products
=
create_list
(
:product
,
3
)
@product_1
=
@products
.
first
@product_1
=
@products
.
first
@product_1
.
update
(
catalog_
list:
[
'衣服'
]
)
@product_1
.
update
(
catalog_
ids:
@clothes
.
id
)
@series
=
create
(
:product_series
,
product:
@product_1
)
@series
=
create
(
:product_series
,
product:
@product_1
)
end
end
...
@@ -17,20 +17,19 @@ RSpec.describe "#{namespace}/products", type: :request, capture_examples: true,
...
@@ -17,20 +17,19 @@ RSpec.describe "#{namespace}/products", type: :request, capture_examples: true,
get
(
summary:
'用户 商品列表'
)
do
get
(
summary:
'用户 商品列表'
)
do
parameter
:page
,
in: :query
,
type: :string
parameter
:page
,
in: :query
,
type: :string
parameter
:per_page
,
in: :query
,
type: :string
parameter
:per_page
,
in: :query
,
type: :string
parameter
:catalog_
list
,
in: :query
,
type: :array
parameter
:catalog_
ids
,
in: :query
,
type: :array
let
(
:page
)
{
1
}
let
(
:page
)
{
1
}
let
(
:per_page
)
{
2
}
let
(
:per_page
)
{
999
}
produces
'application/json'
produces
'application/json'
consumes
'application/json'
consumes
'application/json'
response
(
200
,
description:
'successful'
)
do
response
(
200
,
description:
'successful'
)
do
it
{
expect
(
JSON
.
parse
(
response
.
body
)[
'products'
].
count
).
to
eq
(
2
)
}
it
{
expect
(
JSON
.
parse
(
response
.
body
)[
'products'
].
count
).
to
eq
(
Product
.
count
)
}
end
end
response
(
200
,
description:
'filter by catalog'
)
do
response
(
200
,
description:
'filter by catalog'
)
do
let
(
:catalog_ids
)
{
[
@clothes
.
id
]
}
let
(
:catalog_list
)
{
@product_1
.
catalog_list
}
it
{
expect
(
JSON
.
parse
(
response
.
body
)[
'products'
].
count
).
to
eq
(
1
)
}
it
{
expect
(
JSON
.
parse
(
response
.
body
)[
'products'
].
count
).
to
eq
(
1
)
}
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