couch_visible 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ Then /^the document should be marked as shown$/ do
2
+ @document.shown?.should be(true)
3
+ @document.couch_visible.should be(true)
4
+ end
5
+
6
+ Given /^a document that is not shown$/ do
7
+ class HiddenDoc < CouchRest::Model::Base
8
+ include CouchVisible
9
+ end
10
+
11
+ @document = HiddenDoc.new.tap {|d| d.hide! and d.save }
12
+ end
13
+
14
+ When /^I call the "by_shown" method$/ do
15
+ @result = TestDoc.by_shown :reduce => false
16
+ end
17
+
18
+ Then /^I should receive the shown documents$/ do
19
+ @result.collect(&:id).sort.should == @shown_documents.collect(&:id).sort
20
+ end
21
+
22
+ Then /^I should not receive the hidden documents$/ do
23
+ @result_ids = @result.collect &:id
24
+ @hidden_documents.collect(&:id).each do |hidden_id|
25
+ @result_ids.include?(hidden_id).should be(false)
26
+ end
27
+
28
+ end
29
+
30
+ When /^I call the "count_shown" method on my document model$/ do
31
+ @result = TestDoc.count_shown
32
+ end
33
+
34
+ Then /^I should receive the count of shown documents$/ do
35
+ @result.should == @shown_documents.count
36
+ end
@@ -0,0 +1,1152 @@
1
+ !RBIX
2
+ 17831730954501249321
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 184
13
+ 5
14
+ 7
15
+ 0
16
+ 13
17
+ 70
18
+ 9
19
+ 19
20
+ 15
21
+ 44
22
+ 43
23
+ 1
24
+ 7
25
+ 2
26
+ 78
27
+ 49
28
+ 3
29
+ 2
30
+ 6
31
+ 0
32
+ 56
33
+ 4
34
+ 47
35
+ 50
36
+ 5
37
+ 1
38
+ 15
39
+ 5
40
+ 7
41
+ 6
42
+ 13
43
+ 70
44
+ 9
45
+ 45
46
+ 15
47
+ 44
48
+ 43
49
+ 1
50
+ 7
51
+ 7
52
+ 78
53
+ 49
54
+ 3
55
+ 2
56
+ 6
57
+ 6
58
+ 56
59
+ 8
60
+ 47
61
+ 50
62
+ 9
63
+ 1
64
+ 15
65
+ 5
66
+ 7
67
+ 10
68
+ 13
69
+ 70
70
+ 9
71
+ 71
72
+ 15
73
+ 44
74
+ 43
75
+ 1
76
+ 7
77
+ 11
78
+ 78
79
+ 49
80
+ 3
81
+ 2
82
+ 6
83
+ 10
84
+ 56
85
+ 12
86
+ 47
87
+ 50
88
+ 13
89
+ 1
90
+ 15
91
+ 5
92
+ 7
93
+ 14
94
+ 13
95
+ 70
96
+ 9
97
+ 97
98
+ 15
99
+ 44
100
+ 43
101
+ 1
102
+ 7
103
+ 15
104
+ 78
105
+ 49
106
+ 3
107
+ 2
108
+ 6
109
+ 14
110
+ 56
111
+ 16
112
+ 47
113
+ 50
114
+ 5
115
+ 1
116
+ 15
117
+ 5
118
+ 7
119
+ 17
120
+ 13
121
+ 70
122
+ 9
123
+ 123
124
+ 15
125
+ 44
126
+ 43
127
+ 1
128
+ 7
129
+ 18
130
+ 78
131
+ 49
132
+ 3
133
+ 2
134
+ 6
135
+ 17
136
+ 56
137
+ 19
138
+ 47
139
+ 50
140
+ 5
141
+ 1
142
+ 15
143
+ 5
144
+ 7
145
+ 20
146
+ 13
147
+ 70
148
+ 9
149
+ 149
150
+ 15
151
+ 44
152
+ 43
153
+ 1
154
+ 7
155
+ 21
156
+ 78
157
+ 49
158
+ 3
159
+ 2
160
+ 6
161
+ 20
162
+ 56
163
+ 22
164
+ 47
165
+ 50
166
+ 13
167
+ 1
168
+ 15
169
+ 5
170
+ 7
171
+ 23
172
+ 13
173
+ 70
174
+ 9
175
+ 175
176
+ 15
177
+ 44
178
+ 43
179
+ 1
180
+ 7
181
+ 24
182
+ 78
183
+ 49
184
+ 3
185
+ 2
186
+ 6
187
+ 23
188
+ 56
189
+ 25
190
+ 47
191
+ 50
192
+ 5
193
+ 1
194
+ 15
195
+ 2
196
+ 11
197
+ I
198
+ 4
199
+ I
200
+ 0
201
+ I
202
+ 0
203
+ I
204
+ 0
205
+ n
206
+ p
207
+ 26
208
+ n
209
+ x
210
+ 6
211
+ Regexp
212
+ s
213
+ 40
214
+ ^the document should be marked as shown$
215
+ x
216
+ 3
217
+ new
218
+ M
219
+ 1
220
+ p
221
+ 2
222
+ x
223
+ 9
224
+ for_block
225
+ t
226
+ n
227
+ x
228
+ 9
229
+ __block__
230
+ i
231
+ 30
232
+ 39
233
+ 0
234
+ 49
235
+ 1
236
+ 0
237
+ 5
238
+ 2
239
+ 47
240
+ 49
241
+ 2
242
+ 1
243
+ 49
244
+ 3
245
+ 1
246
+ 15
247
+ 39
248
+ 0
249
+ 49
250
+ 4
251
+ 0
252
+ 5
253
+ 2
254
+ 47
255
+ 49
256
+ 2
257
+ 1
258
+ 49
259
+ 3
260
+ 1
261
+ 11
262
+ I
263
+ 4
264
+ I
265
+ 0
266
+ I
267
+ 0
268
+ I
269
+ 0
270
+ I
271
+ -2
272
+ p
273
+ 5
274
+ x
275
+ 9
276
+ @document
277
+ x
278
+ 6
279
+ shown?
280
+ x
281
+ 2
282
+ be
283
+ x
284
+ 6
285
+ should
286
+ x
287
+ 13
288
+ couch_visible
289
+ p
290
+ 5
291
+ I
292
+ 0
293
+ I
294
+ 2
295
+ I
296
+ f
297
+ I
298
+ 3
299
+ I
300
+ 1e
301
+ x
302
+ 80
303
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
304
+ p
305
+ 0
306
+ x
307
+ 4
308
+ Then
309
+ n
310
+ s
311
+ 30
312
+ ^a document that is not shown$
313
+ M
314
+ 1
315
+ p
316
+ 2
317
+ x
318
+ 9
319
+ for_block
320
+ t
321
+ n
322
+ x
323
+ 9
324
+ __block__
325
+ i
326
+ 65
327
+ 99
328
+ 7
329
+ 0
330
+ 45
331
+ 1
332
+ 2
333
+ 43
334
+ 3
335
+ 43
336
+ 4
337
+ 65
338
+ 49
339
+ 5
340
+ 3
341
+ 13
342
+ 99
343
+ 12
344
+ 7
345
+ 6
346
+ 12
347
+ 7
348
+ 7
349
+ 12
350
+ 65
351
+ 12
352
+ 49
353
+ 8
354
+ 4
355
+ 15
356
+ 49
357
+ 6
358
+ 0
359
+ 15
360
+ 45
361
+ 0
362
+ 9
363
+ 13
364
+ 71
365
+ 10
366
+ 47
367
+ 9
368
+ 54
369
+ 47
370
+ 49
371
+ 11
372
+ 0
373
+ 13
374
+ 47
375
+ 49
376
+ 12
377
+ 0
378
+ 15
379
+ 8
380
+ 57
381
+ 49
382
+ 10
383
+ 0
384
+ 56
385
+ 13
386
+ 50
387
+ 14
388
+ 0
389
+ 38
390
+ 15
391
+ 11
392
+ I
393
+ 7
394
+ I
395
+ 0
396
+ I
397
+ 0
398
+ I
399
+ 0
400
+ I
401
+ -2
402
+ p
403
+ 16
404
+ x
405
+ 9
406
+ HiddenDoc
407
+ x
408
+ 9
409
+ CouchRest
410
+ n
411
+ x
412
+ 5
413
+ Model
414
+ x
415
+ 4
416
+ Base
417
+ x
418
+ 10
419
+ open_class
420
+ x
421
+ 14
422
+ __class_init__
423
+ M
424
+ 1
425
+ n
426
+ n
427
+ x
428
+ 9
429
+ HiddenDoc
430
+ i
431
+ 11
432
+ 5
433
+ 66
434
+ 5
435
+ 45
436
+ 0
437
+ 1
438
+ 47
439
+ 49
440
+ 2
441
+ 1
442
+ 11
443
+ I
444
+ 2
445
+ I
446
+ 0
447
+ I
448
+ 0
449
+ I
450
+ 0
451
+ n
452
+ p
453
+ 3
454
+ x
455
+ 12
456
+ CouchVisible
457
+ n
458
+ x
459
+ 7
460
+ include
461
+ p
462
+ 3
463
+ I
464
+ 2
465
+ I
466
+ 8
467
+ I
468
+ b
469
+ x
470
+ 80
471
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
472
+ p
473
+ 0
474
+ x
475
+ 13
476
+ attach_method
477
+ n
478
+ x
479
+ 3
480
+ new
481
+ x
482
+ 8
483
+ allocate
484
+ x
485
+ 10
486
+ initialize
487
+ M
488
+ 1
489
+ p
490
+ 2
491
+ x
492
+ 9
493
+ for_block
494
+ t
495
+ n
496
+ x
497
+ 9
498
+ __block__
499
+ i
500
+ 19
501
+ 57
502
+ 19
503
+ 0
504
+ 15
505
+ 20
506
+ 0
507
+ 49
508
+ 0
509
+ 0
510
+ 13
511
+ 9
512
+ 18
513
+ 15
514
+ 20
515
+ 0
516
+ 49
517
+ 1
518
+ 0
519
+ 11
520
+ I
521
+ 4
522
+ I
523
+ 1
524
+ I
525
+ 1
526
+ I
527
+ 1
528
+ n
529
+ p
530
+ 2
531
+ x
532
+ 5
533
+ hide!
534
+ x
535
+ 4
536
+ save
537
+ p
538
+ 3
539
+ I
540
+ 0
541
+ I
542
+ b
543
+ I
544
+ 13
545
+ x
546
+ 80
547
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
548
+ p
549
+ 1
550
+ x
551
+ 1
552
+ d
553
+ x
554
+ 3
555
+ tap
556
+ x
557
+ 9
558
+ @document
559
+ p
560
+ 5
561
+ I
562
+ 0
563
+ I
564
+ 7
565
+ I
566
+ 21
567
+ I
568
+ b
569
+ I
570
+ 41
571
+ x
572
+ 80
573
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
574
+ p
575
+ 0
576
+ x
577
+ 5
578
+ Given
579
+ n
580
+ s
581
+ 30
582
+ ^I call the "by_shown" method$
583
+ M
584
+ 1
585
+ p
586
+ 2
587
+ x
588
+ 9
589
+ for_block
590
+ t
591
+ n
592
+ x
593
+ 9
594
+ __block__
595
+ i
596
+ 24
597
+ 45
598
+ 0
599
+ 1
600
+ 44
601
+ 43
602
+ 2
603
+ 79
604
+ 49
605
+ 3
606
+ 1
607
+ 13
608
+ 7
609
+ 4
610
+ 3
611
+ 49
612
+ 5
613
+ 2
614
+ 15
615
+ 49
616
+ 6
617
+ 1
618
+ 38
619
+ 7
620
+ 11
621
+ I
622
+ 6
623
+ I
624
+ 0
625
+ I
626
+ 0
627
+ I
628
+ 0
629
+ I
630
+ -2
631
+ p
632
+ 8
633
+ x
634
+ 7
635
+ TestDoc
636
+ n
637
+ x
638
+ 4
639
+ Hash
640
+ x
641
+ 16
642
+ new_from_literal
643
+ x
644
+ 6
645
+ reduce
646
+ x
647
+ 3
648
+ []=
649
+ x
650
+ 8
651
+ by_shown
652
+ x
653
+ 7
654
+ @result
655
+ p
656
+ 3
657
+ I
658
+ 0
659
+ I
660
+ f
661
+ I
662
+ 18
663
+ x
664
+ 80
665
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
666
+ p
667
+ 0
668
+ x
669
+ 4
670
+ When
671
+ n
672
+ s
673
+ 38
674
+ ^I should receive the shown documents$
675
+ M
676
+ 1
677
+ p
678
+ 2
679
+ x
680
+ 9
681
+ for_block
682
+ t
683
+ n
684
+ x
685
+ 9
686
+ __block__
687
+ i
688
+ 48
689
+ 39
690
+ 0
691
+ 7
692
+ 1
693
+ 13
694
+ 70
695
+ 10
696
+ 15
697
+ 44
698
+ 43
699
+ 2
700
+ 12
701
+ 49
702
+ 3
703
+ 1
704
+ 50
705
+ 4
706
+ 0
707
+ 49
708
+ 5
709
+ 0
710
+ 49
711
+ 6
712
+ 0
713
+ 39
714
+ 7
715
+ 7
716
+ 1
717
+ 13
718
+ 70
719
+ 10
720
+ 39
721
+ 44
722
+ 43
723
+ 2
724
+ 12
725
+ 49
726
+ 3
727
+ 1
728
+ 50
729
+ 4
730
+ 0
731
+ 49
732
+ 5
733
+ 0
734
+ 83
735
+ 8
736
+ 11
737
+ I
738
+ 5
739
+ I
740
+ 0
741
+ I
742
+ 0
743
+ I
744
+ 0
745
+ I
746
+ -2
747
+ p
748
+ 9
749
+ x
750
+ 7
751
+ @result
752
+ x
753
+ 2
754
+ id
755
+ x
756
+ 4
757
+ Proc
758
+ x
759
+ 14
760
+ __from_block__
761
+ x
762
+ 7
763
+ collect
764
+ x
765
+ 4
766
+ sort
767
+ x
768
+ 6
769
+ should
770
+ x
771
+ 16
772
+ @shown_documents
773
+ x
774
+ 2
775
+ ==
776
+ p
777
+ 3
778
+ I
779
+ 0
780
+ I
781
+ 13
782
+ I
783
+ 30
784
+ x
785
+ 80
786
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
787
+ p
788
+ 0
789
+ n
790
+ s
791
+ 43
792
+ ^I should not receive the hidden documents$
793
+ M
794
+ 1
795
+ p
796
+ 2
797
+ x
798
+ 9
799
+ for_block
800
+ t
801
+ n
802
+ x
803
+ 9
804
+ __block__
805
+ i
806
+ 45
807
+ 39
808
+ 0
809
+ 7
810
+ 1
811
+ 13
812
+ 70
813
+ 10
814
+ 15
815
+ 44
816
+ 43
817
+ 2
818
+ 12
819
+ 49
820
+ 3
821
+ 1
822
+ 50
823
+ 4
824
+ 0
825
+ 38
826
+ 5
827
+ 15
828
+ 39
829
+ 6
830
+ 7
831
+ 1
832
+ 13
833
+ 70
834
+ 10
835
+ 36
836
+ 44
837
+ 43
838
+ 2
839
+ 12
840
+ 49
841
+ 3
842
+ 1
843
+ 50
844
+ 4
845
+ 0
846
+ 56
847
+ 7
848
+ 50
849
+ 8
850
+ 0
851
+ 11
852
+ I
853
+ 4
854
+ I
855
+ 0
856
+ I
857
+ 0
858
+ I
859
+ 0
860
+ I
861
+ -2
862
+ p
863
+ 9
864
+ x
865
+ 7
866
+ @result
867
+ x
868
+ 2
869
+ id
870
+ x
871
+ 4
872
+ Proc
873
+ x
874
+ 14
875
+ __from_block__
876
+ x
877
+ 7
878
+ collect
879
+ x
880
+ 11
881
+ @result_ids
882
+ x
883
+ 17
884
+ @hidden_documents
885
+ M
886
+ 1
887
+ p
888
+ 2
889
+ x
890
+ 9
891
+ for_block
892
+ t
893
+ n
894
+ x
895
+ 9
896
+ __block__
897
+ i
898
+ 21
899
+ 57
900
+ 19
901
+ 0
902
+ 15
903
+ 39
904
+ 0
905
+ 20
906
+ 0
907
+ 49
908
+ 1
909
+ 1
910
+ 5
911
+ 3
912
+ 47
913
+ 49
914
+ 2
915
+ 1
916
+ 49
917
+ 3
918
+ 1
919
+ 11
920
+ I
921
+ 5
922
+ I
923
+ 1
924
+ I
925
+ 1
926
+ I
927
+ 1
928
+ n
929
+ p
930
+ 4
931
+ x
932
+ 11
933
+ @result_ids
934
+ x
935
+ 8
936
+ include?
937
+ x
938
+ 2
939
+ be
940
+ x
941
+ 6
942
+ should
943
+ p
944
+ 5
945
+ I
946
+ 0
947
+ I
948
+ 18
949
+ I
950
+ 4
951
+ I
952
+ 19
953
+ I
954
+ 15
955
+ x
956
+ 80
957
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
958
+ p
959
+ 1
960
+ x
961
+ 9
962
+ hidden_id
963
+ x
964
+ 4
965
+ each
966
+ p
967
+ 5
968
+ I
969
+ 0
970
+ I
971
+ 17
972
+ I
973
+ 15
974
+ I
975
+ 18
976
+ I
977
+ 2d
978
+ x
979
+ 80
980
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
981
+ p
982
+ 0
983
+ n
984
+ s
985
+ 54
986
+ ^I call the "count_shown" method on my document model$
987
+ M
988
+ 1
989
+ p
990
+ 2
991
+ x
992
+ 9
993
+ for_block
994
+ t
995
+ n
996
+ x
997
+ 9
998
+ __block__
999
+ i
1000
+ 9
1001
+ 45
1002
+ 0
1003
+ 1
1004
+ 49
1005
+ 2
1006
+ 0
1007
+ 38
1008
+ 3
1009
+ 11
1010
+ I
1011
+ 2
1012
+ I
1013
+ 0
1014
+ I
1015
+ 0
1016
+ I
1017
+ 0
1018
+ I
1019
+ -2
1020
+ p
1021
+ 4
1022
+ x
1023
+ 7
1024
+ TestDoc
1025
+ n
1026
+ x
1027
+ 11
1028
+ count_shown
1029
+ x
1030
+ 7
1031
+ @result
1032
+ p
1033
+ 3
1034
+ I
1035
+ 0
1036
+ I
1037
+ 1f
1038
+ I
1039
+ 9
1040
+ x
1041
+ 80
1042
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
1043
+ p
1044
+ 0
1045
+ n
1046
+ s
1047
+ 47
1048
+ ^I should receive the count of shown documents$
1049
+ M
1050
+ 1
1051
+ p
1052
+ 2
1053
+ x
1054
+ 9
1055
+ for_block
1056
+ t
1057
+ n
1058
+ x
1059
+ 9
1060
+ __block__
1061
+ i
1062
+ 13
1063
+ 39
1064
+ 0
1065
+ 49
1066
+ 1
1067
+ 0
1068
+ 39
1069
+ 2
1070
+ 49
1071
+ 3
1072
+ 0
1073
+ 83
1074
+ 4
1075
+ 11
1076
+ I
1077
+ 3
1078
+ I
1079
+ 0
1080
+ I
1081
+ 0
1082
+ I
1083
+ 0
1084
+ I
1085
+ -2
1086
+ p
1087
+ 5
1088
+ x
1089
+ 7
1090
+ @result
1091
+ x
1092
+ 6
1093
+ should
1094
+ x
1095
+ 16
1096
+ @shown_documents
1097
+ x
1098
+ 5
1099
+ count
1100
+ x
1101
+ 2
1102
+ ==
1103
+ p
1104
+ 3
1105
+ I
1106
+ 0
1107
+ I
1108
+ 23
1109
+ I
1110
+ d
1111
+ x
1112
+ 80
1113
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
1114
+ p
1115
+ 0
1116
+ p
1117
+ 15
1118
+ I
1119
+ 0
1120
+ I
1121
+ 1
1122
+ I
1123
+ 1a
1124
+ I
1125
+ 6
1126
+ I
1127
+ 34
1128
+ I
1129
+ e
1130
+ I
1131
+ 4e
1132
+ I
1133
+ 12
1134
+ I
1135
+ 68
1136
+ I
1137
+ 16
1138
+ I
1139
+ 82
1140
+ I
1141
+ 1e
1142
+ I
1143
+ 9c
1144
+ I
1145
+ 22
1146
+ I
1147
+ b8
1148
+ x
1149
+ 80
1150
+ /Users/mparker/work/github/couch_visible/features/step_definitions/show_steps.rb
1151
+ p
1152
+ 0