This repository was archived by the owner on Dec 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -640,5 +640,27 @@ class JustSpec: QuickSpec {
640640 expect ( r. ok) . to ( beTrue ( ) )
641641 }
642642 }
643+
644+ describe ( " link header support " ) {
645+ it ( " should always have a value for .links " ) {
646+ expect ( Just . get ( " https://api.github.com/users/dduan/repos?page=1&per_page=10 " ) . links) . toNot ( beNil ( ) )
647+ }
648+ it ( " should contain key \" next \" for this specific github API " ) {
649+ let r = Just . get ( " https://api.github.com/users/dduan/repos?page=1&per_page=10 " )
650+ expect ( r. ok) . to ( beTrue ( ) )
651+ expect ( r. links [ " next " ] ) . toNot ( beNil ( ) )
652+ }
653+ it ( " should contain key \" last \" for this specific github API " ) {
654+ let r = Just . get ( " https://api.github.com/users/dduan/repos?page=1&per_page=10 " )
655+ expect ( r. ok) . to ( beTrue ( ) )
656+ expect ( r. links [ " last " ] ) . toNot ( beNil ( ) )
657+ }
658+ it ( " should contain key \" url \" in \" next \" and \" last \" for this specific github API " ) {
659+ let r = Just . get ( " https://api.github.com/users/dduan/repos?page=1&per_page=10 " )
660+ expect ( r. links [ " next " ] ? [ " url " ] ) . toNot ( beNil ( ) )
661+ expect ( r. links [ " last " ] ? [ " url " ] ) . toNot ( beNil ( ) )
662+
663+ }
664+ }
643665 }
644666}
You can’t perform that action at this time.
0 commit comments