Permalink
Browse files

Getting rid of deprecation warnings with some command line magic insp…

…ired by Flo :-)
  • Loading branch information...
1 parent f8e979e commit 59b421a4ba02fba81e1780bd9b18b549ee225d69 @PragTob committed Apr 14, 2012
Showing with 109 additions and 109 deletions.
  1. +2 −2 spec/acceptance/step_definitions/global_steps.rb
  2. +1 −1 spec/acceptance/step_definitions/user_story_steps.rb
  3. +4 −4 spec/controllers/comments_controller_spec.rb
  4. +1 −1 spec/controllers/projects_controller_spec.rb
  5. +3 −3 spec/controllers/sessions_controller_spec.rb
  6. +13 −13 spec/controllers/sprints_controller_spec.rb
  7. +22 −22 spec/controllers/user_stories_controller_spec.rb
  8. +9 −9 spec/controllers/users_controller_spec.rb
  9. +3 −3 spec/helpers/current_helper_spec.rb
  10. +1 −1 spec/helpers/sprints_helper_spec.rb
  11. +2 −2 spec/helpers/user_stories_helper_spec.rb
  12. +2 −2 spec/helpers/users_helper_spec.rb
  13. +5 −5 spec/models/user_spec.rb
  14. +11 −11 spec/models/user_story_spec.rb
  15. +1 −1 spec/spec_helper_methods.rb
  16. +1 −1 spec/views/projects/edit.html.erb_spec.rb
  17. +1 −1 spec/views/projects/new.html.erb_spec.rb
  18. +2 −2 spec/views/projects/show.html.erb_spec.rb
  19. +5 −5 spec/views/sprints/current_sprint_overview.html.erb_spec.rb
  20. +1 −1 spec/views/sprints/show.html.erb_spec.rb
  21. +5 −5 spec/views/sprints/sprint_planning.html.erb_spec.rb
  22. +3 −3 spec/views/user_stories/edit.html.erb_spec.rb
  23. +3 −3 spec/views/user_stories/index.html.erb_spec.rb
  24. +1 −1 spec/views/user_stories/new.html.erb_spec.rb
  25. +2 −2 spec/views/user_stories/show.html.erb_spec.rb
  26. +1 −1 spec/views/users/edit.html.erb_spec.rb
  27. +2 −2 spec/views/users/index.html.erb_spec.rb
  28. +1 −1 spec/views/users/new.html.erb_spec.rb
  29. +1 −1 spec/views/users/show.html.erb_spec.rb
@@ -1,13 +1,13 @@
step "I am logged in" do
- @user = Factory :user
+ @user = FactoryGirl.create :user
visit signin_path
fill_in 'Email', with: @user.email
fill_in 'Password', with: @user.password
click_on 'Sign in'
end
step "there is a project" do
- @project = Factory :project
+ @project = FactoryGirl.create :project
end
step "I am on the current sprint page" do
@@ -3,7 +3,7 @@
CHANGED_NAME = "changed name"
step "there is a user story" do
- @user_story = Factory(:user_story)
+ @user_story = FactoryGirl.create(:user_story)
end
step "I should see the name of the user story" do
@@ -10,8 +10,8 @@ def valid_attributes
describe "with valid params" do
before :each do
- @user_story = Factory(:user_story)
- @user = Factory(:other_user)
+ @user_story = FactoryGirl.create(:user_story)
+ @user = FactoryGirl.create(:other_user)
test_sign_in @user
end
@@ -60,7 +60,7 @@ def valid_attributes
before :each do
# 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))
end
@@ -81,7 +81,7 @@ def valid_attributes
describe "DELETE destroy" do
before :each do
- @user_story = Factory(:user_story)
+ @user_story = FactoryGirl.create(:user_story)
end
it "destroys the requested comment" do
@@ -7,7 +7,7 @@ def valid_attributes
end
def create_project
- @project = Factory :project
+ @project = FactoryGirl.create :project
end
describe "GET show" do
@@ -28,7 +28,7 @@
describe "and accepted" do
before(:each) do
- @user = Factory(:user)
+ @user = FactoryGirl.create(:user)
@attr = { :email => @user.email, :password => @user.password }
end
@@ -47,7 +47,7 @@
describe "and not accepted" do
before(:each) do
- @user = Factory(:unaccepted_user)
+ @user = FactoryGirl.create(:unaccepted_user)
@attr = { :email => @user.email, :password => @user.password }
end
@@ -67,7 +67,7 @@
describe "DELETE 'destroy'" do
it "should sign a user out" do
- test_sign_in(Factory(:user))
+ test_sign_in(FactoryGirl.create(:user))
delete :destroy
controller.should_not be_signed_in
controller.current_user.should be_nil
@@ -10,7 +10,7 @@ def valid_attributes
before :each do
sign_in_a_user
- @project = Factory(:project)
+ @project = FactoryGirl.create(:project)
end
describe "GET index" do
@@ -189,7 +189,7 @@ def valid_attributes
describe "POST stop" 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
@time = DateTime.now
Timecop.freeze(@time)
@@ -254,21 +254,21 @@ def valid_attributes
describe "Sprint dashboard actions" do
before (:each) do
- @project = Factory(:project)
+ @project = FactoryGirl.create(:project)
end
describe "GET 'sprint_planning'" do
before(:each) do
- @user_story = Factory(:user_story, status: "inactive")
- @other_user_story = Factory(:user_story, status: "inactive")
+ @user_story = FactoryGirl.create(:user_story, status: "inactive")
+ @other_user_story = FactoryGirl.create(:user_story, status: "inactive")
sign_in_a_saved_user
end
describe "with current sprint" do
before(:each) do
- @sprint = Factory(:sprint)
+ @sprint = FactoryGirl.create(:sprint)
@project.update_attributes(current_sprint: @sprint)
@project.save
@user_story.update_attributes(sprint: @sprint)
@@ -317,11 +317,11 @@ def valid_attributes
describe "with current sprint" do
before(:each) do
- @sprint = Factory(:sprint)
- @user = Factory(:user)
- @user_story = Factory(:user_story, status: UserStory::INACTIVE,
+ @sprint = FactoryGirl.create(:sprint)
+ @user = FactoryGirl.create(:user)
+ @user_story = FactoryGirl.create(:user_story, status: UserStory::INACTIVE,
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])
@project.update_attributes(current_sprint: @sprint)
test_sign_in(@user)
@@ -343,8 +343,8 @@ def valid_attributes
end
it "assigns all accepted users exept of the current one to @users" do
- other_user = Factory(:other_user)
- unaccepted_user = Factory(:unaccepted_user)
+ other_user = FactoryGirl.create(:other_user)
+ unaccepted_user = FactoryGirl.create(:unaccepted_user)
get :current_sprint_overview
assigns(:partners).should eq [other_user]
end
@@ -396,7 +396,7 @@ def valid_attributes
describe "when user is not signed in" do
it "redirects to the sign_in page" do
- Factory :user
+ FactoryGirl.create :user
controller.should_not be_signed_in
get :current_sprint_overview
response.should redirect_to signin_path
@@ -5,7 +5,7 @@
describe "all actions need a logged in user" do
before :each do
- @user_story = Factory(:user_story, status: "inactive")
+ @user_story = FactoryGirl.create(:user_story, status: "inactive")
sign_in_a_user
end
@@ -22,58 +22,58 @@ def valid_attributes
describe "GET current_sprint_list" do
it "assigns only the user stories of the current sprint to @user_stories" do
- @current_sprint = Factory(:sprint)
- @project = Factory(:project, current_sprint: @current_sprint)
- @other_user_story = Factory(:user_story, sprint_id: @current_sprint.id)
+ @current_sprint = FactoryGirl.create(:sprint)
+ @project = FactoryGirl.create(:project, current_sprint: @current_sprint)
+ @other_user_story = FactoryGirl.create(:user_story, sprint_id: @current_sprint.id)
get :current_sprint_list
assigns(:user_stories).should eq([@other_user_story])
end
end
describe "GET completed_stories_list" 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
assigns(:user_stories).should eq([@other_user_story])
end
end
describe "GET work_in_progress_list" 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
assigns(:user_stories).should eq([@other_user_story])
end
end
describe "GET backlog_list" do
it "assigns only the user stories without sprint to @user_stories" do
- @current_sprint = Factory(:sprint)
- @other_user_story = Factory(:user_story, sprint_id: @current_sprint.id)
+ @current_sprint = FactoryGirl.create(:sprint)
+ @other_user_story = FactoryGirl.create(:user_story, sprint_id: @current_sprint.id)
get :backlog_list
assigns(:user_stories).should eq([@user_story])
end
end
describe "GET non_estimated_list" 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
assigns(:user_stories).should eq([@other_user_story])
end
end
describe "GET deleted_list" 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
assigns(:user_stories).should eq [other_story]
end
end
describe "GET requesting_feedback_list" 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
assigns(:user_stories).should eq [other_story]
end
@@ -192,7 +192,7 @@ def valid_attributes
end
it "updates the assigned user" do
- users = [Factory(:user)]
+ users = [FactoryGirl.create(:user)]
put :update, id: @user_story.id,
user_story: { name: "Bla", users: users },
days: "0", hours: "0", minutes: "0", seconds: "30"
@@ -206,7 +206,7 @@ def valid_attributes
end
it "correctly unassigns users if no users are supplied" do
- users = [Factory(:user)]
+ users = [FactoryGirl.create(:user)]
@user_story.users << users
@user_story.save
@@ -250,7 +250,7 @@ def valid_attributes
describe "POST start" do
before do
- @user = Factory(:user)
+ @user = FactoryGirl.create(:user)
test_sign_in @user
end
@@ -280,7 +280,7 @@ def valid_attributes
describe "POST pause" do
before :each do
- @user = Factory(:user)
+ @user = FactoryGirl.create(:user)
test_sign_in @user
end
@@ -305,7 +305,7 @@ def valid_attributes
end
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
post :pause, id: @user_story.id, user: another_user
UserStory.find(@user_story.id).status.should == previous_status
@@ -343,8 +343,8 @@ def valid_attributes
describe "POST assign_sprint" do
it "assignes the user story to the current sprint" do
- @sprint = Factory(:sprint)
- @project = Factory(:project, current_sprint: @sprint)
+ @sprint = FactoryGirl.create(:sprint)
+ @project = FactoryGirl.create(:project, current_sprint: @sprint)
post :assign_sprint, id: @user_story.id
UserStory.find(@user_story.id).sprint.should eq @project.current_sprint
end
@@ -353,7 +353,7 @@ def valid_attributes
describe "POST unassign_sprint" do
it "unassignes the user story" do
- @sprint = Factory(:sprint)
+ @sprint = FactoryGirl.create(:sprint)
@user_story.update_attributes(sprint: @sprint)
post :unassign_sprint, id: @user_story.id
UserStory.find(@user_story.id).sprint.should be_nil
@@ -363,7 +363,7 @@ def valid_attributes
describe "POST resurrect" do
before :each do
- @other = Factory :user_story, status: UserStory::DELETED
+ @other = FactoryGirl.create :user_story, status: UserStory::DELETED
post :resurrect, id: @other.id
end
@@ -394,7 +394,7 @@ def valid_attributes
describe "POST add_user" do
before :each do
- @user = Factory(:user)
+ @user = FactoryGirl.create(:user)
post :add_user, id: @user_story.id, user_id: @user.id
end
@@ -410,7 +410,7 @@ def valid_attributes
describe "POST remove_user" do
before :each do
- @user = Factory(:user)
+ @user = FactoryGirl.create(:user)
@user_story.users << @user
@user_story.save
post :remove_user, id: @user_story.id, user_id: @user.id
Oops, something went wrong.

0 comments on commit 59b421a

Please sign in to comment.