Use shared_examples_for refactor rspec test examples
Improve rspec