title: rspec converting repeat block into method
body: <p>I have this context in my spec file.</p>
  
  <pre><code>  context 'get :index' do 
              it 'should be loaded successfully if current user is not customer' do
                sign_in @creative
                get :index
                response.should be_success 
              end
              it 'should redirect to root page if current user is customer' do 
                sign_in @customer
                get :index
                response.should redirect_to root_path
              end
            end
  
  context 'post :create' do 
              it 'should be loaded successfully if current user is not customer' do
                sign_in @creative
                post :create
                response.should be_success 
              end
              it 'should redirect to root page if current user is customer' do 
                sign_in @customer
                post :create
                response.should redirect_to root_path
              end
            end
  </code></pre>
  
  <p>I repeat the same code in two different context.I convert it like this method but it doesn't work.</p>
  
  <pre><code>def check_user_sign_in(request_type, action)
        context '#{request_type} :#{action}' do 
          it 'should be loaded successfully if current user is not customer' do
            sign_in @creative
            request_type action
            response.should be_success 
          end
          it 'should redirect to root page if current user is customer' do 
            sign_in @customer
            request_type action
            response.should redirect_to root_path
          end
        end
      end
  
    end
  </code></pre>
  
  <p>Here the problem is I didn't use parameter as a method name.</p>
  
  <p>Do you know how can I use it with dry way?</p>