聚合云播

排序

疯狂木乃伊剧情简介

" params[:is_edit_textarea] = false params[:user_id] = "shenjun" put :create, params JSON.parse(response.body) } it "should return article" do article = Article.find_by(title: params[:title]) expect(response_json["id"]).to eq article.id end end context "update" do before{ params[:id] = article.id put :update, params JSON.parse(response.body) } it "should return article" do article = Article.find_by(title: params[:title]) expect(response_json["id"]).to eq article.id end end context "delete" do before{ params[:id] = article.id delete :destroy, params JSON.parse(response.body) } it "should return article" do article = Article.find_by(title: params[:title]) expect(article).to eq nil end end context "index" do before{ get :index JSON.parse(response.body) } it "should return articles" do expect(response_json[0]["title"]).to eq article.title end end context "show" do before{ params[:id] = article.id get :show, params JSON.parse(response.body) } it "should return article" do expect(response_json["title"]).to eq article.title end end endend