randomuser-local-rails 0.4.0.1 → 0.4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/randomuser_local.rb +2 -2
- data/lib/randomuser_local/version.rb +1 -1
- data/test/dummy/log/test.log +72 -0
- data/test/randomuser_local_test.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e309cfe5256e830359af0c7ab96b585178195338
|
4
|
+
data.tar.gz: 252c32a3d43c40361dab084aae7ab4a7762cd6da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da35bf3949e21345b1c32b0f514f2bee7c06d8af6cc44fb96cf4383b258ffdc14dfb3862e41e9efd1bd8c9dccd9d034616d39ec18520daca16193b3ca01099f3
|
7
|
+
data.tar.gz: 65e6949793d67a089366229851f68ef81def1f34aa8f9c5eccb54c5b16b540601298ea300602070675256951dfaa6efb40643b2f25c408ba30c0842a12dbd908
|
data/lib/randomuser_local.rb
CHANGED
@@ -28,11 +28,11 @@ private
|
|
28
28
|
gender = %w(female male).shuffle.first if gender.nil?
|
29
29
|
user[:gender] = gender
|
30
30
|
if gender == 'female'
|
31
|
-
user[:picture] =
|
31
|
+
user[:picture] = "portraits/women/#{rand(0..95)}.jpg"
|
32
32
|
user[:name][:first] = random_user_element('female_first_names')
|
33
33
|
user[:name][:title] = %w(ms mrs).shuffle.first
|
34
34
|
else
|
35
|
-
user[:picture] = "
|
35
|
+
user[:picture] = "portraits/men/#{rand(0..99)}.jpg"
|
36
36
|
user[:name][:first] = random_user_element('male_first_names')
|
37
37
|
user[:name][:title] = 'mr'
|
38
38
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -572,3 +572,75 @@ NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
|
572
572
|
----------------------------------------------------------------------
|
573
573
|
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:40:39 -0400
|
574
574
|
[1m[35m (0.1ms)[0m rollback transaction
|
575
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
576
|
+
------------------------------------------------------------------------
|
577
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
578
|
+
------------------------------------------------------------------------
|
579
|
+
Started GET "/assets/randomuser_local/portraits/women/9.jpg" for 127.0.0.1 at 2014-07-28 19:50:45 -0400
|
580
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
581
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
582
|
+
----------------------------------------------------------------------
|
583
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
584
|
+
----------------------------------------------------------------------
|
585
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:50:45 -0400
|
586
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
587
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
588
|
+
------------------------------------------------------------------------
|
589
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
590
|
+
------------------------------------------------------------------------
|
591
|
+
Started GET "/assets/randomuser_local/portraits/women/9.jpg" for 127.0.0.1 at 2014-07-28 19:51:58 -0400
|
592
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
593
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
594
|
+
----------------------------------------------------------------------
|
595
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
596
|
+
----------------------------------------------------------------------
|
597
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:51:58 -0400
|
598
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
599
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
600
|
+
------------------------------------------------------------------------
|
601
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
602
|
+
------------------------------------------------------------------------
|
603
|
+
Started GET "/randomuser_local/portraits/women/9.jpg" for 127.0.0.1 at 2014-07-28 19:52:29 -0400
|
604
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
605
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
606
|
+
----------------------------------------------------------------------
|
607
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
608
|
+
----------------------------------------------------------------------
|
609
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:52:29 -0400
|
610
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
611
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
612
|
+
------------------------------------------------------------------------
|
613
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
614
|
+
------------------------------------------------------------------------
|
615
|
+
Started GET "/assets/randomuser_local/portraits/women/191.jpg" for 127.0.0.1 at 2014-07-28 19:52:48 -0400
|
616
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
617
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
618
|
+
----------------------------------------------------------------------
|
619
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
620
|
+
----------------------------------------------------------------------
|
621
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:52:48 -0400
|
622
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
623
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
624
|
+
------------------------------------------------------------------------
|
625
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
626
|
+
------------------------------------------------------------------------
|
627
|
+
Started GET "/assets/randomuser_local/portraits/women/9.jpg" for 127.0.0.1 at 2014-07-28 19:52:56 -0400
|
628
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
629
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
630
|
+
----------------------------------------------------------------------
|
631
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
632
|
+
----------------------------------------------------------------------
|
633
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:52:56 -0400
|
634
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
635
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
636
|
+
------------------------------------------------------------------------
|
637
|
+
NavigationTest: test_female_headshots_are_served_with_the_asset_pipeline
|
638
|
+
------------------------------------------------------------------------
|
639
|
+
Started GET "/assets/randomuser_local/portraits/women/9.jpg" for 127.0.0.1 at 2014-07-28 19:53:42 -0400
|
640
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
641
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
642
|
+
----------------------------------------------------------------------
|
643
|
+
NavigationTest: test_male_headshots_are_served_with_the_asset_pipeline
|
644
|
+
----------------------------------------------------------------------
|
645
|
+
Started GET "/assets/randomuser_local/portraits/men/9.jpg" for 127.0.0.1 at 2014-07-28 19:53:42 -0400
|
646
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
@@ -30,7 +30,7 @@ describe RandomuserLocal do
|
|
30
30
|
let(:user) { RandomuserLocal.generate_female }
|
31
31
|
|
32
32
|
it 'returns a female headshot path' do
|
33
|
-
user[:picture].must_match
|
33
|
+
user[:picture].must_match /portraits\/women/
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -39,7 +39,7 @@ describe RandomuserLocal do
|
|
39
39
|
let(:user) { RandomuserLocal.generate_male }
|
40
40
|
|
41
41
|
it 'returns a male headshot path' do
|
42
|
-
user[:picture].must_match
|
42
|
+
user[:picture].must_match /portraits\/men/
|
43
43
|
end
|
44
44
|
|
45
45
|
end
|