Small refactoring of calculate_setup_progress, part II
This commit is contained in:
parent
d910a0f532
commit
ac0abce6e1
2 changed files with 4 additions and 4 deletions
|
|
@ -707,7 +707,7 @@ class Conference < ActiveRecord::Base
|
||||||
# ====Returns
|
# ====Returns
|
||||||
# * +Fixnum+ -> Progress in Percent
|
# * +Fixnum+ -> Progress in Percent
|
||||||
def calculate_setup_progress(result)
|
def calculate_setup_progress(result)
|
||||||
(result.values.count(true) / result.values.count.to_f * 100).round(0).to_s
|
(100 * result.values.count(true) / result.values.count).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -994,7 +994,7 @@ describe Conference do
|
||||||
subject.splashpage = create(:splashpage, public: false)
|
subject.splashpage = create(:splashpage, public: false)
|
||||||
|
|
||||||
@result_false['registration'] = true
|
@result_false['registration'] = true
|
||||||
@result_false['process'] = 13.to_s
|
@result_false['process'] = 12.to_s
|
||||||
|
|
||||||
expect(subject.get_status).to eq(@result_false)
|
expect(subject.get_status).to eq(@result_false)
|
||||||
end
|
end
|
||||||
|
|
@ -1033,7 +1033,7 @@ describe Conference do
|
||||||
@result_false['cfp'] = true
|
@result_false['cfp'] = true
|
||||||
@result_false['registration'] = true
|
@result_false['registration'] = true
|
||||||
@result_false['venue'] = true
|
@result_false['venue'] = true
|
||||||
@result_false['process'] = 38.to_s
|
@result_false['process'] = 37.to_s
|
||||||
|
|
||||||
expect(subject.get_status).to eq(@result_false)
|
expect(subject.get_status).to eq(@result_false)
|
||||||
end
|
end
|
||||||
|
|
@ -1076,7 +1076,7 @@ describe Conference do
|
||||||
@result_false['venue'] = true
|
@result_false['venue'] = true
|
||||||
@result_false['rooms'] = true
|
@result_false['rooms'] = true
|
||||||
@result_false['tracks'] = true
|
@result_false['tracks'] = true
|
||||||
@result_false['process'] = 63.to_s
|
@result_false['process'] = 62.to_s
|
||||||
|
|
||||||
expect(subject.get_status).to eq(@result_false)
|
expect(subject.get_status).to eq(@result_false)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue