I'm using RSpec (through the gem rspec-rails) for testing and developing
Then, I've tried to "test" a controller and run up against a something
that in last, I'm not understanding: post and get methods.
I've searched them in RoR doc, but their's not documented.
In my route file:
controller :sessions do
post 'login', action: :login_create
get 'login', action: :login
get 'logout', action: :logout
At the beginning, I was thinking that post will simulate an http post
request at the specified url, while get a http get one, so I've writed:
describe "POST 'login'" do
it "returns http success" do
response.should render_template 'sessions/login_create'
But this will load the login action and not the login_create! After a
lot of searching and trying, I've wrote:
... And it works as expected. However, after that I've tried:
... And this works also! O_o
So, what this kind of methods really do and how are intended to be used?