Skip to content

Commit

Permalink
Fixed users number issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoriamr committed Jan 25, 2018
1 parent 0c61944 commit 5935e4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/lib/mconf/statistics_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
subject { Mconf::StatisticsModule }

describe "total_users" do
let(:data) { {:all=>1, :approved=>1, :not_approved=>0, :disabled=>0} }
let(:data) { {:all=>2, :approved=>2, :not_approved=>0, :disabled=>0} }
let(:nil_data) { {:all=>0, :approved=>0, :not_approved=>0, :disabled=>0} }

it "function with arguments returns 'user' and with nil returns 0" do
Expand Down Expand Up @@ -58,7 +58,7 @@
end

describe "generate" do
let(:data) { {:users=>{:all=>1, :approved=>1, :not_approved=>0, :disabled=>0}, :spaces=>{:all=>1, :private=>1, :public=>0, :disabled=>0}, :meetings=>{:all=>1, :average=>0, :total=>0}, :recordings=>{:all=>1, :size=>0, :average=>5, :total=>5}}}
let(:data) { {:users=>{:all=>2, :approved=>2, :not_approved=>0, :disabled=>0}, :spaces=>{:all=>1, :private=>1, :public=>0, :disabled=>0}, :meetings=>{:all=>1, :average=>0, :total=>0}, :recordings=>{:all=>1, :size=>0, :average=>5, :total=>5}}}
let(:nil_data) { {:users=>{:all=>0, :approved=>0, :not_approved=>0, :disabled=>0}, :spaces=>{:all=>0, :private=>0, :public=>0, :disabled=>0}, :meetings=>{:all=>0, :average=>0, :total=>0}, :recordings=>{:all=>0, :size=>0, :average=>0, :total=>0}} }

it "function with arguments returns 'user, space, meeting and recording' (all data) and with nil returns nothing" do
Expand All @@ -68,7 +68,7 @@
end

describe "generate_csv" do
let(:data) {"users.all,users.approved,users.not_approved,users.disabled,spaces.all,spaces.private,spaces.public,spaces.disabled,meetings.all,meetings.average,meetings.total,recordings.all,recordings.size,recordings.average,recordings.total\n1,1,0,0,1,1,0,0,1,0,0,1,0,5,5\n"}
let(:data) {"users.all,users.approved,users.not_approved,users.disabled,spaces.all,spaces.private,spaces.public,spaces.disabled,meetings.all,meetings.average,meetings.total,recordings.all,recordings.size,recordings.average,recordings.total\n2,2,0,0,1,1,0,0,1,0,0,1,0,5,5\n"}

it "function with arguments returns file .csv and with nil returns nil" do
subject.generate_csv(start_date, end_date).should eql(data)
Expand Down

0 comments on commit 5935e4f

Please sign in to comment.