We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9b722e commit 4090834Copy full SHA for 4090834
spec/controllers/protips_controller_spec.rb
@@ -49,10 +49,19 @@ def valid_session
49
# end
50
51
52
- describe "GET show" do
53
- it "assigns the requested protip as @protip" do
+ describe "GET show using public_id" do
+ it "redirects to GET show using slug" do
54
protip = Protip.create! valid_attributes
55
get :show, {id: protip.to_param}, valid_session
56
+ expect(response).to redirect_to protip_path(protip.slug)
57
+ end
58
59
+
60
+ describe "GET show using slug" do
61
+ it "assigns the requested protip as @protip" do
62
+ protip = Protip.create! valid_attributes
63
+ protip.save
64
+ get :show, {id: protip.friendly_id}, valid_session
65
expect(assigns(:protip)).to eq(protip)
66
end
67
0 commit comments