Plasma rotation or its shear is important in the formation of a transport barrier. It is believed that a rotating helical magnetic field generated by a dynamic ergodic divertor (DED) can generate a rotational torque in tokamak plasmas, and therefore control the rotation profiles. To measure the plasma rotations and investigate the effect of DEDs on them, we developed a passive spectroscopic measurement system for the small tokamak HYBTOK-II. A spontaneous toroidal plasma rotation in the co-current direction and poloidal plasma rotation in the electron diamagnetic drift direction have been observed without using a DED. Considerable changes in the plasma flow have been obtained using a DED for reducing toroidal and poloidal rotation velocities near the resonant magnetic surface. The change in the plasma rotation velocity was found to couple with the change in the radial electric field.