mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-16 13:03:16 -04:00
Delete specs for unused views and controller methods.
This commit is contained in:
@@ -24,7 +24,7 @@ describe AuthenticationsController do
|
||||
# Authentication. As you add validations to Authentication, be sure to
|
||||
# update the return value of this method accordingly.
|
||||
def valid_attributes
|
||||
{ "member_id" => "1" }
|
||||
{ }
|
||||
end
|
||||
|
||||
# This should return the minimal set of values that should be in the session
|
||||
@@ -42,29 +42,6 @@ describe AuthenticationsController do
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it "assigns the requested authentication as @authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
get :show, {:id => authentication.to_param}, valid_session
|
||||
assigns(:authentication).should eq(authentication)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET new" do
|
||||
it "assigns a new authentication as @authentication" do
|
||||
get :new, {}, valid_session
|
||||
assigns(:authentication).should be_a_new(Authentication)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
it "assigns the requested authentication as @authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
get :edit, {:id => authentication.to_param}, valid_session
|
||||
assigns(:authentication).should eq(authentication)
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST create" do
|
||||
describe "with valid params" do
|
||||
it "creates a new Authentication" do
|
||||
@@ -102,50 +79,6 @@ describe AuthenticationsController do
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT update" do
|
||||
describe "with valid params" do
|
||||
it "updates the requested authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
# Assuming there are no other authentications in the database, this
|
||||
# specifies that the Authentication created on the previous line
|
||||
# receives the :update_attributes message with whatever params are
|
||||
# submitted in the request.
|
||||
Authentication.any_instance.should_receive(:update_attributes).with({ "member_id" => "1" })
|
||||
put :update, {:id => authentication.to_param, :authentication => { "member_id" => "1" }}, valid_session
|
||||
end
|
||||
|
||||
it "assigns the requested authentication as @authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
put :update, {:id => authentication.to_param, :authentication => valid_attributes}, valid_session
|
||||
assigns(:authentication).should eq(authentication)
|
||||
end
|
||||
|
||||
it "redirects to the authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
put :update, {:id => authentication.to_param, :authentication => valid_attributes}, valid_session
|
||||
response.should redirect_to(authentication)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with invalid params" do
|
||||
it "assigns the authentication as @authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Authentication.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => authentication.to_param, :authentication => { "member_id" => "invalid value" }}, valid_session
|
||||
assigns(:authentication).should eq(authentication)
|
||||
end
|
||||
|
||||
it "re-renders the 'edit' template" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
# Trigger the behavior that occurs when invalid params are submitted
|
||||
Authentication.any_instance.stub(:save).and_return(false)
|
||||
put :update, {:id => authentication.to_param, :authentication => { "member_id" => "invalid value" }}, valid_session
|
||||
response.should render_template("edit")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE destroy" do
|
||||
it "destroys the requested authentication" do
|
||||
authentication = Authentication.create! valid_attributes
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the AuthenticationsHelper. For example:
|
||||
#
|
||||
# describe AuthenticationsHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# helper.concat_strings("this","that").should == "this that"
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
describe AuthenticationsHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
@@ -1,24 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "authentications/edit" do
|
||||
before(:each) do
|
||||
@authentication = assign(:authentication, stub_model(Authentication,
|
||||
:member_id => 1,
|
||||
:provider => "MyString",
|
||||
:uid => "MyString",
|
||||
:secret => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit authentication form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form", :action => authentications_path(@authentication), :method => "post" do
|
||||
assert_select "input#authentication_member_id", :name => "authentication[member_id]"
|
||||
assert_select "input#authentication_provider", :name => "authentication[provider]"
|
||||
assert_select "input#authentication_uid", :name => "authentication[uid]"
|
||||
assert_select "input#authentication_secret", :name => "authentication[secret]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7,13 +7,13 @@ describe "authentications/index" do
|
||||
:member_id => 1,
|
||||
:provider => "Provider",
|
||||
:uid => "Uid",
|
||||
:secret => "Secret"
|
||||
:name => "Name"
|
||||
),
|
||||
stub_model(Authentication,
|
||||
:member_id => 1,
|
||||
:provider => "Provider",
|
||||
:uid => "Uid",
|
||||
:secret => "Secret"
|
||||
:name => "Name"
|
||||
)
|
||||
])
|
||||
end
|
||||
@@ -21,9 +21,8 @@ describe "authentications/index" do
|
||||
it "renders a list of authentications" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => 1.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Provider".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Uid".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Secret".to_s, :count => 2
|
||||
assert_select ".authentication", :count => 2
|
||||
assert_select ".provider", :text => "Provider".to_s, :count => 2
|
||||
assert_select ".name", :text => "Name".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "authentications/new" do
|
||||
before(:each) do
|
||||
assign(:authentication, stub_model(Authentication,
|
||||
:member_id => 1,
|
||||
:provider => "MyString",
|
||||
:uid => "MyString",
|
||||
:secret => "MyString"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new authentication form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form", :action => authentications_path, :method => "post" do
|
||||
assert_select "input#authentication_member_id", :name => "authentication[member_id]"
|
||||
assert_select "input#authentication_provider", :name => "authentication[provider]"
|
||||
assert_select "input#authentication_uid", :name => "authentication[uid]"
|
||||
assert_select "input#authentication_secret", :name => "authentication[secret]"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,21 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "authentications/show" do
|
||||
before(:each) do
|
||||
@authentication = assign(:authentication, stub_model(Authentication,
|
||||
:member_id => 1,
|
||||
:provider => "Provider",
|
||||
:uid => "Uid",
|
||||
:secret => "Secret"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders attributes in <p>" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
rendered.should match(/1/)
|
||||
rendered.should match(/Provider/)
|
||||
rendered.should match(/Uid/)
|
||||
rendered.should match(/Secret/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user