fixes specs
This commit is contained in:
@@ -10,7 +10,7 @@ describe Users::RegistrationsController do
|
|||||||
|
|
||||||
context "when username is available" do
|
context "when username is available" do
|
||||||
it "should return true with no error message" do
|
it "should return true with no error message" do
|
||||||
post :check_username, username: "available username"
|
get :check_username, username: "available username"
|
||||||
|
|
||||||
data = JSON.parse response.body, symbolize_names: true
|
data = JSON.parse response.body, symbolize_names: true
|
||||||
expect(data[:available]).to be true
|
expect(data[:available]).to be true
|
||||||
@@ -19,9 +19,9 @@ describe Users::RegistrationsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "when username is not available" do
|
context "when username is not available" do
|
||||||
it "should return true with no error message" do
|
it "should return false with an error message" do
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
post :check_username, username: user.username
|
get :check_username, username: user.username
|
||||||
|
|
||||||
data = JSON.parse response.body, symbolize_names: true
|
data = JSON.parse response.body, symbolize_names: true
|
||||||
expect(data[:available]).to be false
|
expect(data[:available]).to be false
|
||||||
@@ -31,4 +31,4 @@ describe Users::RegistrationsController do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user