describe :git_sha do it "should read the file correctly" do controller.stub!(:current_user).and_return(nil) File.should_receive(:open).with("#{Rails.root}/REVISION").and_return(stub(read: "aaa")) get :git_sha response.body.should == "aaa" end end