Skip to content

Commit

Permalink
Getting rid of deprecation warnings with some command line magic insp…
Browse files Browse the repository at this point in the history
…ired by Flo :-)
  • Loading branch information
PragTob committed Apr 14, 2012
1 parent f8e979e commit 59b421a
Show file tree
Hide file tree
Showing 29 changed files with 109 additions and 109 deletions.
4 changes: 2 additions & 2 deletions spec/acceptance/step_definitions/global_steps.rb
@@ -1,13 +1,13 @@
step "I am logged in" do step "I am logged in" do
@user = Factory :user @user = FactoryGirl.create :user
visit signin_path visit signin_path
fill_in 'Email', with: @user.email fill_in 'Email', with: @user.email
fill_in 'Password', with: @user.password fill_in 'Password', with: @user.password
click_on 'Sign in' click_on 'Sign in'
end end


step "there is a project" do step "there is a project" do
@project = Factory :project @project = FactoryGirl.create :project
end end


step "I am on the current sprint page" do step "I am on the current sprint page" do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/step_definitions/user_story_steps.rb
Expand Up @@ -3,7 +3,7 @@
CHANGED_NAME = "changed name" CHANGED_NAME = "changed name"


step "there is a user story" do step "there is a user story" do
@user_story = Factory(:user_story) @user_story = FactoryGirl.create(:user_story)
end end


step "I should see the name of the user story" do step "I should see the name of the user story" do
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/comments_controller_spec.rb
Expand Up @@ -10,8 +10,8 @@ def valid_attributes
describe "with valid params" do describe "with valid params" do


before :each do before :each do
@user_story = Factory(:user_story) @user_story = FactoryGirl.create(:user_story)
@user = Factory(:other_user) @user = FactoryGirl.create(:other_user)
test_sign_in @user test_sign_in @user
end end


Expand Down Expand Up @@ -60,7 +60,7 @@ def valid_attributes


before :each do before :each do
# lil hack since request.referrer isn't set # lil hack since request.referrer isn't set
@user_story = Factory :user_story @user_story = FactoryGirl.create :user_story
controller.request.stub(referrer: user_story_path(@user_story)) controller.request.stub(referrer: user_story_path(@user_story))
end end


Expand All @@ -81,7 +81,7 @@ def valid_attributes
describe "DELETE destroy" do describe "DELETE destroy" do


before :each do before :each do
@user_story = Factory(:user_story) @user_story = FactoryGirl.create(:user_story)
end end


it "destroys the requested comment" do it "destroys the requested comment" do
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/projects_controller_spec.rb
Expand Up @@ -7,7 +7,7 @@ def valid_attributes
end end


def create_project def create_project
@project = Factory :project @project = FactoryGirl.create :project
end end


describe "GET show" do describe "GET show" do
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/sessions_controller_spec.rb
Expand Up @@ -28,7 +28,7 @@
describe "and accepted" do describe "and accepted" do


before(:each) do before(:each) do
@user = Factory(:user) @user = FactoryGirl.create(:user)
@attr = { :email => @user.email, :password => @user.password } @attr = { :email => @user.email, :password => @user.password }
end end


Expand All @@ -47,7 +47,7 @@
describe "and not accepted" do describe "and not accepted" do


before(:each) do before(:each) do
@user = Factory(:unaccepted_user) @user = FactoryGirl.create(:unaccepted_user)
@attr = { :email => @user.email, :password => @user.password } @attr = { :email => @user.email, :password => @user.password }
end end


Expand All @@ -67,7 +67,7 @@
describe "DELETE 'destroy'" do describe "DELETE 'destroy'" do


it "should sign a user out" do it "should sign a user out" do
test_sign_in(Factory(:user)) test_sign_in(FactoryGirl.create(:user))
delete :destroy delete :destroy
controller.should_not be_signed_in controller.should_not be_signed_in
controller.current_user.should be_nil controller.current_user.should be_nil
Expand Down
26 changes: 13 additions & 13 deletions spec/controllers/sprints_controller_spec.rb
Expand Up @@ -10,7 +10,7 @@ def valid_attributes


before :each do before :each do
sign_in_a_user sign_in_a_user
@project = Factory(:project) @project = FactoryGirl.create(:project)
end end


describe "GET index" do describe "GET index" do
Expand Down Expand Up @@ -189,7 +189,7 @@ def valid_attributes
describe "POST stop" do describe "POST stop" do


before :each do before :each do
@sprint = Factory(:sprint, end_date: DateTime.now - 1) @sprint = FactoryGirl.create(:sprint, end_date: DateTime.now - 1)
@project.current_sprint = @sprint @project.current_sprint = @sprint
@time = DateTime.now @time = DateTime.now
Timecop.freeze(@time) Timecop.freeze(@time)
Expand Down Expand Up @@ -254,21 +254,21 @@ def valid_attributes
describe "Sprint dashboard actions" do describe "Sprint dashboard actions" do


before (:each) do before (:each) do
@project = Factory(:project) @project = FactoryGirl.create(:project)
end end


describe "GET 'sprint_planning'" do describe "GET 'sprint_planning'" do


before(:each) do before(:each) do
@user_story = Factory(:user_story, status: "inactive") @user_story = FactoryGirl.create(:user_story, status: "inactive")
@other_user_story = Factory(:user_story, status: "inactive") @other_user_story = FactoryGirl.create(:user_story, status: "inactive")
sign_in_a_saved_user sign_in_a_saved_user
end end


describe "with current sprint" do describe "with current sprint" do


before(:each) do before(:each) do
@sprint = Factory(:sprint) @sprint = FactoryGirl.create(:sprint)
@project.update_attributes(current_sprint: @sprint) @project.update_attributes(current_sprint: @sprint)
@project.save @project.save
@user_story.update_attributes(sprint: @sprint) @user_story.update_attributes(sprint: @sprint)
Expand Down Expand Up @@ -317,11 +317,11 @@ def valid_attributes
describe "with current sprint" do describe "with current sprint" do


before(:each) do before(:each) do
@sprint = Factory(:sprint) @sprint = FactoryGirl.create(:sprint)
@user = Factory(:user) @user = FactoryGirl.create(:user)
@user_story = Factory(:user_story, status: UserStory::INACTIVE, @user_story = FactoryGirl.create(:user_story, status: UserStory::INACTIVE,
sprint: @sprint) sprint: @sprint)
@other_user_story = Factory(:user_story, status: UserStory::ACTIVE, @other_user_story = FactoryGirl.create(:user_story, status: UserStory::ACTIVE,
sprint: @sprint, users: [@user]) sprint: @sprint, users: [@user])
@project.update_attributes(current_sprint: @sprint) @project.update_attributes(current_sprint: @sprint)
test_sign_in(@user) test_sign_in(@user)
Expand All @@ -343,8 +343,8 @@ def valid_attributes
end end


it "assigns all accepted users exept of the current one to @users" do it "assigns all accepted users exept of the current one to @users" do
other_user = Factory(:other_user) other_user = FactoryGirl.create(:other_user)
unaccepted_user = Factory(:unaccepted_user) unaccepted_user = FactoryGirl.create(:unaccepted_user)
get :current_sprint_overview get :current_sprint_overview
assigns(:partners).should eq [other_user] assigns(:partners).should eq [other_user]
end end
Expand Down Expand Up @@ -396,7 +396,7 @@ def valid_attributes
describe "when user is not signed in" do describe "when user is not signed in" do


it "redirects to the sign_in page" do it "redirects to the sign_in page" do
Factory :user FactoryGirl.create :user
controller.should_not be_signed_in controller.should_not be_signed_in
get :current_sprint_overview get :current_sprint_overview
response.should redirect_to signin_path response.should redirect_to signin_path
Expand Down
44 changes: 22 additions & 22 deletions spec/controllers/user_stories_controller_spec.rb
Expand Up @@ -5,7 +5,7 @@
describe "all actions need a logged in user" do describe "all actions need a logged in user" do


before :each do before :each do
@user_story = Factory(:user_story, status: "inactive") @user_story = FactoryGirl.create(:user_story, status: "inactive")
sign_in_a_user sign_in_a_user
end end


Expand All @@ -22,58 +22,58 @@ def valid_attributes


describe "GET current_sprint_list" do describe "GET current_sprint_list" do
it "assigns only the user stories of the current sprint to @user_stories" do it "assigns only the user stories of the current sprint to @user_stories" do
@current_sprint = Factory(:sprint) @current_sprint = FactoryGirl.create(:sprint)
@project = Factory(:project, current_sprint: @current_sprint) @project = FactoryGirl.create(:project, current_sprint: @current_sprint)
@other_user_story = Factory(:user_story, sprint_id: @current_sprint.id) @other_user_story = FactoryGirl.create(:user_story, sprint_id: @current_sprint.id)
get :current_sprint_list get :current_sprint_list
assigns(:user_stories).should eq([@other_user_story]) assigns(:user_stories).should eq([@other_user_story])
end end
end end


describe "GET completed_stories_list" do describe "GET completed_stories_list" do
it "assigns only the completed user stories to @user_stories" do it "assigns only the completed user stories to @user_stories" do
@other_user_story = Factory(:user_story, status: UserStory::COMPLETED) @other_user_story = FactoryGirl.create(:user_story, status: UserStory::COMPLETED)
get :completed_stories_list get :completed_stories_list
assigns(:user_stories).should eq([@other_user_story]) assigns(:user_stories).should eq([@other_user_story])
end end
end end


describe "GET work_in_progress_list" do describe "GET work_in_progress_list" do
it "assigns only the WiP user stories to @user_stories" do it "assigns only the WiP user stories to @user_stories" do
@other_user_story = Factory(:user_story, status: UserStory::ACTIVE) @other_user_story = FactoryGirl.create(:user_story, status: UserStory::ACTIVE)
get :work_in_progress_list get :work_in_progress_list
assigns(:user_stories).should eq([@other_user_story]) assigns(:user_stories).should eq([@other_user_story])
end end
end end


describe "GET backlog_list" do describe "GET backlog_list" do
it "assigns only the user stories without sprint to @user_stories" do it "assigns only the user stories without sprint to @user_stories" do
@current_sprint = Factory(:sprint) @current_sprint = FactoryGirl.create(:sprint)
@other_user_story = Factory(:user_story, sprint_id: @current_sprint.id) @other_user_story = FactoryGirl.create(:user_story, sprint_id: @current_sprint.id)
get :backlog_list get :backlog_list
assigns(:user_stories).should eq([@user_story]) assigns(:user_stories).should eq([@user_story])
end end
end end


describe "GET non_estimated_list" do describe "GET non_estimated_list" do
it "assigns only the user stories without estimation to @user_stories" do it "assigns only the user stories without estimation to @user_stories" do
@other_user_story = Factory(:user_story, estimation: nil) @other_user_story = FactoryGirl.create(:user_story, estimation: nil)
get :non_estimated_list get :non_estimated_list
assigns(:user_stories).should eq([@other_user_story]) assigns(:user_stories).should eq([@other_user_story])
end end
end end


describe "GET deleted_list" do describe "GET deleted_list" do
it "assigns only the deleted stories" do it "assigns only the deleted stories" do
other_story = Factory :user_story, status: UserStory::DELETED other_story = FactoryGirl.create :user_story, status: UserStory::DELETED
get :deleted_list get :deleted_list
assigns(:user_stories).should eq [other_story] assigns(:user_stories).should eq [other_story]
end end
end end


describe "GET requesting_feedback_list" do describe "GET requesting_feedback_list" do
it "assigns only the stories requesting feedback" do it "assigns only the stories requesting feedback" do
other_story = Factory :user_story, requesting_feedback: true other_story = FactoryGirl.create :user_story, requesting_feedback: true
get :requesting_feedback_list get :requesting_feedback_list
assigns(:user_stories).should eq [other_story] assigns(:user_stories).should eq [other_story]
end end
Expand Down Expand Up @@ -192,7 +192,7 @@ def valid_attributes
end end


it "updates the assigned user" do it "updates the assigned user" do
users = [Factory(:user)] users = [FactoryGirl.create(:user)]
put :update, id: @user_story.id, put :update, id: @user_story.id,
user_story: { name: "Bla", users: users }, user_story: { name: "Bla", users: users },
days: "0", hours: "0", minutes: "0", seconds: "30" days: "0", hours: "0", minutes: "0", seconds: "30"
Expand All @@ -206,7 +206,7 @@ def valid_attributes
end end


it "correctly unassigns users if no users are supplied" do it "correctly unassigns users if no users are supplied" do
users = [Factory(:user)] users = [FactoryGirl.create(:user)]
@user_story.users << users @user_story.users << users
@user_story.save @user_story.save


Expand Down Expand Up @@ -250,7 +250,7 @@ def valid_attributes


describe "POST start" do describe "POST start" do
before do before do
@user = Factory(:user) @user = FactoryGirl.create(:user)
test_sign_in @user test_sign_in @user
end end


Expand Down Expand Up @@ -280,7 +280,7 @@ def valid_attributes
describe "POST pause" do describe "POST pause" do


before :each do before :each do
@user = Factory(:user) @user = FactoryGirl.create(:user)
test_sign_in @user test_sign_in @user
end end


Expand All @@ -305,7 +305,7 @@ def valid_attributes
end end


it "can only be suspended by a user that is working on the story" do it "can only be suspended by a user that is working on the story" do
another_user = Factory(:other_user) another_user = FactoryGirl.create(:other_user)
previous_status = @user_story.status previous_status = @user_story.status
post :pause, id: @user_story.id, user: another_user post :pause, id: @user_story.id, user: another_user
UserStory.find(@user_story.id).status.should == previous_status UserStory.find(@user_story.id).status.should == previous_status
Expand Down Expand Up @@ -343,8 +343,8 @@ def valid_attributes
describe "POST assign_sprint" do describe "POST assign_sprint" do


it "assignes the user story to the current sprint" do it "assignes the user story to the current sprint" do
@sprint = Factory(:sprint) @sprint = FactoryGirl.create(:sprint)
@project = Factory(:project, current_sprint: @sprint) @project = FactoryGirl.create(:project, current_sprint: @sprint)
post :assign_sprint, id: @user_story.id post :assign_sprint, id: @user_story.id
UserStory.find(@user_story.id).sprint.should eq @project.current_sprint UserStory.find(@user_story.id).sprint.should eq @project.current_sprint
end end
Expand All @@ -353,7 +353,7 @@ def valid_attributes


describe "POST unassign_sprint" do describe "POST unassign_sprint" do
it "unassignes the user story" do it "unassignes the user story" do
@sprint = Factory(:sprint) @sprint = FactoryGirl.create(:sprint)
@user_story.update_attributes(sprint: @sprint) @user_story.update_attributes(sprint: @sprint)
post :unassign_sprint, id: @user_story.id post :unassign_sprint, id: @user_story.id
UserStory.find(@user_story.id).sprint.should be_nil UserStory.find(@user_story.id).sprint.should be_nil
Expand All @@ -363,7 +363,7 @@ def valid_attributes
describe "POST resurrect" do describe "POST resurrect" do


before :each do before :each do
@other = Factory :user_story, status: UserStory::DELETED @other = FactoryGirl.create :user_story, status: UserStory::DELETED
post :resurrect, id: @other.id post :resurrect, id: @other.id
end end


Expand Down Expand Up @@ -394,7 +394,7 @@ def valid_attributes
describe "POST add_user" do describe "POST add_user" do


before :each do before :each do
@user = Factory(:user) @user = FactoryGirl.create(:user)
post :add_user, id: @user_story.id, user_id: @user.id post :add_user, id: @user_story.id, user_id: @user.id
end end


Expand All @@ -410,7 +410,7 @@ def valid_attributes
describe "POST remove_user" do describe "POST remove_user" do


before :each do before :each do
@user = Factory(:user) @user = FactoryGirl.create(:user)
@user_story.users << @user @user_story.users << @user
@user_story.save @user_story.save
post :remove_user, id: @user_story.id, user_id: @user.id post :remove_user, id: @user_story.id, user_id: @user.id
Expand Down

0 comments on commit 59b421a

Please sign in to comment.