Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Faker::Subscription #1440

Merged
merged 9 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- [PR #803](https://github.com/stympy/faker/pull/803) Modify Faker::Educator, Fix #576 [@ghbooth12](https://github.com/ghbooth12)

### Documentation
- [PR #1445](https://github.com/stympy/faker/pull/1445) Separate README.md: unreleased and latest version [@vbrazo](https://github.com/vbrazo)
- [PR #1243](https://github.com/stympy/faker/pull/1243) Add image file method to placeholdit [@nicolas-brousse](https://github.com/nicolas-brousse)
- [PR #1419](https://github.com/stympy/faker/pull/1419) Update CONTRIBUTING.md [@vbrazo](https://github.com/vbrazo)
- [PR #1414](https://github.com/stympy/faker/pull/1414) Fixing spelling mistake in Docs for Vehicle [@snoozins](https://github.com/snoozins)
Expand All @@ -52,6 +53,7 @@
- [PR #1329](https://github.com/stympy/faker/pull/1329) Update docs on behavior of price [@softwaregravy](https://github.com/softwaregravy)

### Feature Request
- [PR #1440](https://github.com/stympy/faker/pull/1440) Add Faker::Subscription [@fabersky](https://github.com/fabersky)
- [PR #1438](https://github.com/stympy/faker/pull/1438) Add Faker::Football.position [@fblupi](https://github.com/fblupi)
- [PR #1426](https://github.com/stympy/faker/pull/1426) Add Faker::PhoneNumber.country_code [@AmrAdelKhalil](https://github.com/AmrAdelKhalil)
- [PR #1427](https://github.com/stympy/faker/pull/1427) Add Faker::Games::SuperSmashBros [@boardfish](https://github.com/boardfish)
Expand Down Expand Up @@ -95,6 +97,7 @@
- [PR #1246](https://github.com/stympy/faker/pull/1246) Store list of generators with enabled uniqueness for faster clear [@MarcPer](https://github.com/MarcPer)

### Update/add locales
- [PR #1446](https://github.com/stympy/faker/pull/1446) fix: Remove deplicate 'color' from ja.yml [@yizknn](https://github.com/yizknn)
- [PR #1441](https://github.com/stympy/faker/pull/1441) Add Faker::Job pt-BR locales [@wellingtongvs](https://github.com/wellingtongvs)
- [PR #1428](https://github.com/stympy/faker/pull/1428) Add Faker::Games::SonicTheHedgehog.game [@boardfish](https://github.com/boardfish)
- [PR #1415](https://github.com/stympy/faker/pull/1415) Add new Overwatch items [@lucasqueiroz](https://github.com/lucasqueiroz)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Contents
--------

- [Installing](#installing)
- [Usage](#usage)
- [Usage - v1.9.1](#usage)
- [Faker::Address](doc/v1.9.1/address.md)
- [Faker::Ancient](doc/v1.9.1/ancient.md)
- [Faker::App](doc/v1.9.1/app.md)
Expand Down
13 changes: 13 additions & 0 deletions doc/unreleased/subscription.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Faker::Subscription

```ruby
Faker::Subscription.plan #=> "Platinum"

Faker::Subscription.status #=> "Active"

Faker::Subscription.payment_method #=> "Paypal"

Faker::Subscription.subscription_term #=> "Annual"

Faker::Subscription.payment_term #=> "Monthly"
```
25 changes: 25 additions & 0 deletions lib/faker/subscription.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

module Faker
class Subscription < Base
def self.plan
fetch('subscription.plans')
end

def self.status
fetch('subscription.statuses')
end

def self.payment_method
fetch('subscription.payment_methods')
end

def self.subscription_term
fetch('subscription.subscription_terms')
end

def self.payment_term
fetch('subscription.payment_terms')
end
end
end
8 changes: 8 additions & 0 deletions lib/locales/en/subscription.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
en:
faker:
subscription:
plans: ["Free Trial", "Basic", "Starter", "Essential", "Student", Bronze", "Standard", "Silver", "Gold", "Platinum", "Professional", "Business", "Diamond", "Premium"]
statuses: ["Active", "Idle", "Blocked", "Pending"]
payment_methods: ["Credit card", "Debit card", "Paypal", "Cash", "Money transfer", "Bitcoins", "Cheque", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa checkout"]
subscription_terms: ["Daily", "Weekly", "Monthly", "Annual", "Biennal", "Triennal", "Quinquennal", "Lifetime"]
payment_terms: ["Payment in advance", "Monthly", "Annual", "Full subscription"]
10 changes: 8 additions & 2 deletions lib/locales/es-MX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ es-MX:

internet:
free_email: [gmail.com, yahoo.com, hotmail.com, prodigy.net.mx]
domain_suffix: [com, com.mx, mx, info, me, org, org.mx,]
domain_suffix: [com, com.mx, mx, info, me, org, org.mx]

name:
first_name: [José Luis, Juan, Francisco, José, Antonio, Jesús, Miguel Ángel, Pedro, Alejandro, Manuel, Juan Carlos, Roberto, Jorge, Carlos, Fernando, Ricardo, Miguel, Javier, Martín, Rafael, Raúl, Arturo, Daniel, Eduardo, Enrique, Mario, José Antonio, Sergio, Gerardo, Salvador, Marco Antonio, Alfredo, David, Armando, Alberto, Luis, Óscar, Ramón, Guillermo, Rubén, Jaime, Felipe, Julio César, Andrés, Pablo, Ángel, Gabriel, Héctor, Alfonso, José Guadalupe, Agustín, Ignacio, Víctor, Rogelio, Gustavo, Ernesto, Rodolfo, Luis Alberto, Gilberto, Vicente, Juan Antonio, Tomás, Israel, César, Adrián, Ismael, Santiago, Humberto, Gregorio, Joel, Esteban, José Alfredo, Nicolás, Omar, Moisés, Félix, Lorenzo, Samuel, Carlos Alberto, José Angel, Ramiro, Abel, Jorge Luis, Marcos, Mario Alberto, Rodrigo, Edgar, Isidro, José Alberto, Leonardo, Benjamín, Jorge Alberto, Julio, Raymundo, Víctor Hugo, Saúl, Benito, José Juan, Rigoberto, Hugo, Guadalupe, María, Margarita, Verónica, María Elena, Josefina, Leticia, Teresa, Patricia, Rosa, Martha, Rosa María, Alicia, Yolanda, Francisca, Silvia, Elizabeth, Gloria, Ana María, Gabriela, Alejandra, María Luisa, María de Lourdes, Adriana, Araceli, Antonia, Lucía, Carmen, Irma, Claudia, Beatriz, Isabel, Laura, Maribel, Graciela, Virginia, Catalina, Esperanza, Angélica, Maricela, Cecilia, Susana, Cristina, Julia, Concepción, Victoria, Ofelia, Rocío, Carolina, Raquel, Petra, Lorena, Reyna, Sandra, Paula, Guillermina, Sara, Elvira, Manuela, Marisol, Mónica, Erika, Celia, Luz María, Irene, Magdalena, Estela, Ángela, Rosario, Esther, Eva, Norma, Aurora, Socorro, Consuelo, Lidia, Bertha, Sofía, Dolores, Elena, Rosalba, Liliana, Andrea, Adela, Mariana, Fabiola, Karina, Martina, Marcela, Miriam, Mercedes, Marina, Amalia, Olivia, Angelina, Sonia, Agustina, Edith, Lilia, Micaela]
Expand All @@ -69,7 +69,7 @@ es-MX:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

phone_number:
lada_dos: ["33", "55", "81"]
lada_tres: ["222", "223", "224", "225", "226", "227", "228", "229", "231", "232", "233", "235", "236", "237", "238", "241", "243", "244", "245", "246", "247", "248", "249", "271", "272", "273", "274", "275", "276", "278", "279", "281", "282", "283", "284", "285", "287", "288", "294", "296", "297", "311", "312", "313", "314", "315", "316", "317", "319", "321", "322", "323", "324", "325", "326", "327", "328", "329", "341", "342", "343", "344", "345", "346", "347", "348", "349", "351", "352", "353", "354", "355", "356", "357", "358", "359", "371", "372", "373", "374", "375", "376", "377", "378", "381", "382", "383", "384", "385", "386", "387", "388", "389", "391", "392", "393", "394", "395", "411", "412", "413", "414", "415", "417", "418", "419", "421", "422", "423", "424", "425", "426", "427", "428", "429", "431", "432", "433", "434", "435", "436", "437", "438", "441", "442", "443", "444", "445", "447", "448", "449", "451", "452", "453", "454", "455", "456", "457", "458", "459", "461", "462", "463", "464", "465", "466", "467", "468", "469", "471", "472", "473", "474", "475", "476", "477", "478", "481", "482", "483", "485", "486", "487", "488", "489", "492", "493", "494", "495", "496", "498", "499", "588", "591", "592", "593", "594", "595", "596", "597", "599", "612", "613", "614", "615", "616", "618", "621", "622", "623", "624", "625", "626", "627", "628", "629", "631", "632", "633", "634", "635", "636", "637", "638", "639", "641", "642", "643", "644", "645", "646", "647", "648", "649", "651", "652", "653", "656", "658", "659", "661", "662", "664", "665", "667", "668", "669", "671", "672", "673", "674", "675", "676", "677", "686", "687", "694", "695", "696", "697", "698", "711", "712", "713", "714", "715", "716", "717", "718", "719", "721", "722", "723", "724", "725", "726", "727", "728", "731", "732", "733", "734", "735", "736", "737", "738", "739", "741", "742", "743", "744", "745", "746", "747", "748", "749", "751", "753", "754", "755", "756", "757", "758", "759", "761", "762", "763", "764", "765", "766", "767", "768", "769", "771", "772", "773", "774", "775", "776", "777", "778", "779", "781", "782", "783", "784", "785", "786", "789", "791", "797", "821", "823", "824", "825", "826", "828", "829", "831", "832", "833", "834", "835", "836", "841", "842", "844", "845", "846", "861", "862", "864", "866", "867", "868", "869", "871", "872", "873", "877", "878", "891", "892", "894", "897", "899", "913", "914", "916", "917", "918", "919", "921", "922", "923", "924", "932", "933", "934", "936", "937", "938", "951", "953", "954", "958", "961", "962", "963", "964", "965", "966", "967", "968", "969", "971", "972", "981", "982", "983", "984", "985", "986", "987", "988", "991", "992", "993", "994", "995", "996", "997", "998", "999"]
Expand All @@ -94,3 +94,9 @@ es-MX:
- "044 (#{PhoneNumber.lada_tres}) ### ####"
- "044 #{PhoneNumber.lada_dos}-####-####"
- "044 #{PhoneNumber.lada_tres}-###-####"
subscription:
plans: ["Prueba gratuita", "Basico", "Starter", "Essential", "Estudiante", Bronze", "Standard", "Silver", "Gold", "Platinum", "Profesional", "Business", "Diamond", "Premium"]
statuses: ["Activo", "Parado", "Bloqueado", "Pendiente"]
payment_methods: ["Tarjeta de credito", "Tarjeta de débito", "Paypal", "Efectivo", "Transferencia de dinero", "Bitcoins", "Cheque", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa Checkout"]
subscription_terms: ["Diaria", "Semanal", "Mensual", "Anual", "Bienal", "Trienal", "Quinquenal", "De por vida"]
payment_terms: ["Pago por adelantado", "Mensual", "Anual", "Suscripción completa"]
6 changes: 6 additions & 0 deletions lib/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,9 @@ es:
formats: ['6##-###-###', '6##.###.###', '6## ### ###', '6########']
music:
instruments: ['Guitarra Eléctrica', 'Guitarra Acústica', 'Flauta', 'Trompeta', 'Clarinete', 'Violonchelo', 'Arpa', 'Xilofón', 'Armónica', 'Acordión', 'Organo', 'Piano', 'Ukelele', 'Saxofón', 'Bateria', 'Violín', 'Bajo']
subscription:
plans: ["Prueba gratuita", "Basico", "Starter", "Essential", "Estudiante", Bronze", "Standard", "Silver", "Gold", "Platinum", "Profesional", "Business", "Diamond", "Premium"]
statuses: ["Activo", "Parado", "Bloqueado", "Pendiente"]
payment_methods: ["Tarjeta de credito", "Tarjeta de débito", "Paypal", "Efectivo", "Transferencia de dinero", "Bitcoins", "Cheque", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa Checkout"]
subscription_terms: ["Diaria", "Semanal", "Mensual", "Anual", "Bienal", "Trienal", "Quinquenal", "De por vida"]
payment_terms: ["Pago por adelantado", "Mensual", "Anual", "Suscripción completa"]
6 changes: 6 additions & 0 deletions lib/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ it:
- "#{first_name} #{last_name} #{last_name}"
phone_number:
formats: ['+## ### ## ## ####', '+## ## #######', '+## ## ########', '+## ### #######', '+## ### ########', '+## #### #######', '+## #### ########', '0## ### ####', '+39 0## ### ###', '3## ### ###', '+39 3## ### ###']
subscription:
plans: ["Prova gratuita", "Basico", "Starter", "Essential", "Studente", Bronze", "Standard", "Silver", "Gold", "Platinum", "Profesional", "Business", "Diamond", "Premium"]
statuses: ["Attivo", "Inattivo", "Bloccato", "In sospeso"]
payment_methods: ["Carta di credito", "Carta di debito", "Paypal", "Contanti", "Bonifico", "Bitcoins", "Assegno", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa Checkout"]
subscription_terms: ["Quotidiano", "Settimanale", "Mensile", "Annuale", "Biennale", "Triennale", "Quinquennale", "Abbonamento a vita"]
payment_terms: ["Pagamento anticipato", "Mensile", "Annuale", "Abbonamento completo"]
8 changes: 8 additions & 0 deletions test/test_es_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,12 @@ def test_es_name_methods
def test_es_vehicle_methods
assert Faker::Vehicle.license_plate.is_a? String
end

def test_es_subscription_methods
assert Faker::Subscription.plan.is_a? String
assert Faker::Subscription.status.is_a? String
assert Faker::Subscription.payment_method.is_a? String
assert Faker::Subscription.subscription_term.is_a? String
assert Faker::Subscription.payment_term.is_a? String
end
end
8 changes: 8 additions & 0 deletions test/test_es_mx_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def test_es_mx_phone_number
assert Faker::PhoneNumber.cell_phone.is_a? String
end

def test_es_mx_subscription_methods
assert Faker::Subscription.plan.is_a? String
assert Faker::Subscription.status.is_a? String
assert Faker::Subscription.payment_method.is_a? String
assert Faker::Subscription.subscription_term.is_a? String
assert Faker::Subscription.payment_term.is_a? String
end

def test_es_mx_university_methods
assert Faker::University.suffix.is_a? String
assert Faker::University.prefix.is_a? String
Expand Down
29 changes: 29 additions & 0 deletions test/test_faker_subscription.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require_relative 'test_helper'

class TestFakerSubscription < Test::Unit::TestCase
def setup
@tester = Faker::Subscription
end

def test_plan
assert @tester.plan.match(/\w+/)
end

def test_status
assert @tester.status.match(/\w+/)
end

def test_payment_method
assert @tester.payment_method.match(/\w+/)
end

def test_subscription_term
assert @tester.subscription_term.match(/\w+/)
end

def test_payment_term
assert @tester.payment_term.match(/\w+/)
end
end
8 changes: 8 additions & 0 deletions test/test_it_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ def test_it_name_methods
def test_it_phone_number_methods
assert Faker::PhoneNumber.phone_number.is_a? String
end

def test_it_subscription_methods
assert Faker::Subscription.plan.is_a? String
assert Faker::Subscription.status.is_a? String
assert Faker::Subscription.payment_method.is_a? String
assert Faker::Subscription.subscription_term.is_a? String
assert Faker::Subscription.payment_term.is_a? String
end
end
1 change: 1 addition & 0 deletions unreleased_CONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Contents
- [Faker::StrangerThings](doc/unreleased/stranger_things.md)
- [Faker::String](doc/unreleased/string.md)
- [Faker::Stripe](doc/unreleased/stripe.md)
- [Faker::Subscription](doc/unreleased/subscription.md)
- [Faker::Superhero](doc/unreleased/superhero.md)
- [Faker::Team](doc/unreleased/team.md)
- [Faker::Tezos](doc/unreleased/tezos.md)
Expand Down