Add artist finding tests for new Pixiv URLs.

* Add tests for finding artists using the new Pixiv URLs in Artist#find_all_by_url.
* Add tests for the artist finder JSON API in ArtistsController#finder.
* Add tests for the artist page search form in ArtistsController#index.
This commit is contained in:
evazion
2014-10-05 13:39:55 -05:00
parent 8e2be03a6b
commit a36472f35b
18 changed files with 6166 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
---
http_interactions:
- request:
method: get
uri: http://spapi.pixiv.net/iphone/illust.php?PHPSESSID=696859_80b071246e635ff4098e3f857f1e934a&illust_id=32049358
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- ! '*/*'
User-Agent:
- Mechanize/2.7.2 Ruby/1.9.3p327 (http://github.com/sparklemotion/mechanize/)
Accept-Encoding:
- gzip,deflate,identity
Accept-Charset:
- ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Language:
- en-us,en;q=0.5
Cookie:
- PHPSESSID=696859_80b071246e635ff4098e3f857f1e934a
Host:
- spapi.pixiv.net
Connection:
- keep-alive
Keep-Alive:
- 300
response:
status:
code: 200
message: OK
headers:
Server:
- nginx
Date:
- Sun, 05 Oct 2014 18:16:23 GMT
Content-Type:
- text/html; charset=UTF-8
Content-Length:
- '0'
Connection:
- keep-alive
X-Host-Time:
- '142'
Expires:
- Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control:
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma:
- no-cache
body:
encoding: US-ASCII
string: ''
http_version:
recorded_at: Sun, 05 Oct 2014 18:16:32 GMT
recorded_with: VCR 2.9.0

View File

@@ -0,0 +1,84 @@
---
http_interactions:
- request:
method: get
uri: http://spapi.pixiv.net/iphone/illust.php?PHPSESSID=696859_80b071246e635ff4098e3f857f1e934a&illust_id=46170939
body:
encoding: US-ASCII
string: ''
headers:
Accept:
- ! '*/*'
User-Agent:
- Mechanize/2.7.2 Ruby/1.9.3p327 (http://github.com/sparklemotion/mechanize/)
Accept-Encoding:
- gzip,deflate,identity
Accept-Charset:
- ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Language:
- en-us,en;q=0.5
Cookie:
- PHPSESSID=696859_80b071246e635ff4098e3f857f1e934a
Host:
- spapi.pixiv.net
Connection:
- keep-alive
Keep-Alive:
- 300
response:
status:
code: 200
message: !binary |-
T0s=
headers:
!binary "U2VydmVy":
- !binary |-
bmdpbng=
!binary "RGF0ZQ==":
- !binary |-
U3VuLCAwNSBPY3QgMjAxNCAxODoxNjoyMiBHTVQ=
!binary "Q29udGVudC1UeXBl":
- !binary |-
dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
!binary "Q29udGVudC1MZW5ndGg=":
- !binary |-
NTg3
!binary "Q29ubmVjdGlvbg==":
- !binary |-
a2VlcC1hbGl2ZQ==
!binary "WC1Ib3N0LVRpbWU=":
- !binary |-
MTQ1
!binary "RXhwaXJlcw==":
- !binary |-
VGh1LCAxOSBOb3YgMTk4MSAwODo1MjowMCBHTVQ=
!binary "Q2FjaGUtQ29udHJvbA==":
- !binary |-
bm8tc3RvcmUsIG5vLWNhY2hlLCBtdXN0LXJldmFsaWRhdGUsIHBvc3QtY2hl
Y2s9MCwgcHJlLWNoZWNrPTA=
!binary "UHJhZ21h":
- !binary |-
bm8tY2FjaGU=
!binary "WC1Db250ZW50LVR5cGUtT3B0aW9ucw==":
- !binary |-
bm9zbmlmZg==
body:
encoding: ASCII-8BIT
string: !binary |-
IjQ2MTcwOTM5IiwiMzI3NzciLCJqcGciLCLjg6bjg4vjgrPjg7zjg7MiLCI0
Iiwi44Oe44K144KqIiwiaHR0cDovL2kyLnBpeGl2Lm5ldC9pbWctaW5mL2lt
Zy8yMDE0LzA5LzI1LzAwLzU3LzI0LzQ2MTcwOTM5XzEyOHgxMjguanBnIiws
LCJodHRwOi8vaTIucGl4aXYubmV0L2ltZzA0L2ltZy9zeW91bmVuX25vX3V0
YS9tb2JpbGUvNDYxNzA5MzlfNDgwbXcuanBnIiwsLCIyMDE0LTA5LTI1IDAw
OjU3OjI0Iiwi5ryr55S7IOWUhyDjgqrjg6rjgrjjg4rjg6sg44Om44OL44Kz
44O844OzIOmOpyIsIlBob3Rvc2hvcCBDb21pY1N0dWRpbyIsIjg5MCIsIjg1
NzgiLCIxNzQwMyIsIuWUh+OBjOOBiuawl+OBq+WFpeOCiuOBp+OBmeOAgjxi
ciAvPjxiciAvPuaEj+WkluOBq+aPj+OBj+OBruOBq+aZgumWk+OBi+OBi+OC
iuOBvuOBl+OBn+OAgjxiciAvPu+8lOaZgumWk+OBu+OBqeOBi+OBi+OBo+OB
n+OBqOaAneOBhOOBvuOBmeOAgiIsIjE2IiwsLCI0OTkiLCIxOSIsInN5b3Vu
ZW5fbm9fdXRhIiwsIjAiLCwsImh0dHA6Ly9pMi5waXhpdi5uZXQvaW1nMDQv
cHJvZmlsZS9zeW91bmVuX25vX3V0YS9tb2JpbGUvNTc4MTUyNV84MC5qcGci
LAo=
http_version:
recorded_at: Sun, 05 Oct 2014 18:16:31 GMT
recorded_with: VCR 2.9.0