make requests controller spec a little clearer
This commit is contained in:
parent
1951df8d9c
commit
ccd92fb850
1 changed files with 45 additions and 39 deletions
|
|
@ -13,7 +13,8 @@ describe RequestsController do
|
|||
@user.aspects.create(:name => "lame-os")
|
||||
end
|
||||
|
||||
it "should not error out when requesting to be friends with yourself" do
|
||||
describe '#create' do
|
||||
it "redirects when requesting to be friends with yourself" do
|
||||
put("create", "request" => {
|
||||
"destination_url" => @user.diaspora_handle,
|
||||
"aspect_id" => @user.aspects[0].id
|
||||
|
|
@ -22,25 +23,27 @@ describe RequestsController do
|
|||
response.should redirect_to aspects_manage_path
|
||||
end
|
||||
|
||||
it "should not error out when requesting an invalid identity" do
|
||||
it "flashes and redirects when requesting an invalid identity" do
|
||||
put("create", "request" => {
|
||||
"destination_url" => "not_a_@valid_email",
|
||||
"aspect_id" => @user.aspects[0].id
|
||||
}
|
||||
)
|
||||
flash[:error].should_not be_blank
|
||||
response.should redirect_to aspects_manage_path
|
||||
end
|
||||
|
||||
it "should not error out when requesting an invalid identity with a port number" do
|
||||
it "flashes and redirects when requesting an invalid identity with a port number" do
|
||||
put("create", "request" => {
|
||||
"destination_url" => "johndoe@email.com:3000",
|
||||
"aspect_id" => @user.aspects[0].id
|
||||
}
|
||||
)
|
||||
flash[:error].should_not be_blank
|
||||
response.should redirect_to aspects_manage_path
|
||||
end
|
||||
|
||||
it "should not error out when requesting an identity from an invalid server" do
|
||||
it "redirects when requesting an identity from an invalid server" do
|
||||
stub_request(:get, /notadiasporaserver\.com/).to_raise(Errno::ETIMEDOUT)
|
||||
put("create", "request" => {
|
||||
"destination_url" => "johndoe@notadiasporaserver.com",
|
||||
|
|
@ -51,10 +54,13 @@ describe RequestsController do
|
|||
end
|
||||
|
||||
it 'should redirect to the page which you called it from ' do
|
||||
pending "i need to figure out how to do this"
|
||||
end
|
||||
|
||||
it 'should not blow up if there is a problem mid way thru the webfinger process' do
|
||||
pending "i need to do this tomorrow"
|
||||
pending "This controller should probably redirect to :back"
|
||||
put("create", "request" => {
|
||||
"destination_url" => "johndoe@notadiasporaserver.com",
|
||||
"aspect_id" => @user.aspects[0].id
|
||||
}
|
||||
)
|
||||
response.should redirect_to(:back)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue