so you want to stub this query:
OrganizationalUnit.where("billing_id = ? AND status = 'active'", data[:billing_id]).select(:id)
i think this should be
OrganizationalUnit.stub_chain(:where, :select).and_return(654321)
another thing: it's always a good idea to move finders within methods or scopes in the model. by doing this it is even easier to stub or mock stuff for testing.