adds specs for the bug

pull/981/head
Jonas Heinrich 11 years ago
parent aeb55d8238
commit c488c602a5
  1. 13
      spec/controllers/my_controller_spec.rb
  2. 8
      spec/controllers/users_controller_spec.rb

@ -27,6 +27,7 @@
#++
require 'spec_helper'
require 'work_package'
describe MyController, :type => :controller do
let(:user) { FactoryGirl.create(:user) }
@ -126,4 +127,16 @@ describe MyController, :type => :controller do
end
end
end
describe "index" do
before do
User.stub(:current).and_return user
end
it "passes the correct number of reported work packages for user" do
work_package_double = class_double("WorkPackage")
get :index
work_package_double.should_receive("on_active_project")
work_package_double.should_receive("with_author").with(user)
end
end
end

@ -27,6 +27,7 @@
#++
require 'spec_helper'
require 'work_package'
describe UsersController do
before do
@ -448,5 +449,12 @@ describe UsersController do
it { get :show, id: user.id }
end
it "passes the correct number of reported work packages for user" do
work_package_double = class_double("WorkPackage")
get :show
work_package_double.should_receive("on_active_project")
work_package_double.should_receive("with_author").with(user)
end
end
end

Loading…
Cancel
Save