push
travis-ci
2 of 2 new or added lines in 2 files covered. (100.0%)
4376 of 5076 relevant lines covered (86.21%)
27.95 hits per line
1 |
class Pricelist |
2✔ |
2 |
# TODO: зарефакторить
|
|
3 |
def self.ticket_price |
2✔ |
4 |
if before(2017, 1, 1) |
43✔ |
5 |
990
|
× |
|
elsif before(2017, 2, 1) |
43✔ |
7 |
1330
|
× |
8 |
elsif before(2017, 3, 1) |
43✔ |
9 |
2000
|
43✔ |
10 |
elsif before(2017, 4, 1) |
× |
11 |
2500
|
× |
12 |
elsif before(2017, 4, 9) |
× |
13 |
3500
|
× |
14 |
else
|
|
15 |
4000
|
× |
16 |
end
|
|
17 |
end
|
|
18 |
|
|
19 |
def self.afterparty_ticket_price |
2✔ |
20 |
if before(2017, 1, 1) |
15✔ |
21 |
2500
|
× |
22 |
elsif before(2017, 4, 1) |
15✔ |
23 |
3000
|
15✔ |
24 |
else
|
|
25 |
3500
|
× |
26 |
end
|
|
27 |
end
|
|
28 |
|
|
29 |
private |
2✔ |
30 |
|
|
31 |
def self.before(year, month, day) |
2✔ |
32 |
Time.current.to_date < Date.new(year, month, day) |
159✔ |
33 |
end
|
|
34 |
|
|
35 |
def self.at(year, month, day) |
2✔ |
36 |
Time.current.to_date == Date.new(year, month, day) |
× |
37 |
end
|
|
38 |
end
|