Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. it "increases count by 1" do
  2. attributes = attributes_for(:district)
  3. expect { post admin_districts_path, params: { district: attributes} }.to change { District.count }.by(1)
  4. end
  5.  
  6. it "increases count by 1" do
  7. attributes = attributes_for(:district)
  8. block = { post admin_districts_path, params: { district: attributes} }
  9. expect(block).to change { District.count }.by(1)
  10. end
  11.  
  12. syntax error, unexpected '}', expecting keyword_end
  13.  
  14. it "increases count by 1" do
  15. attributes = attributes_for(:district)
  16. expect do
  17. post admin_districts_path, params: { district: attributes}
  18. end.to change { District.count }.by(1)
  19. end
  20.  
  21. block = -> { post admin_districts_path, params: { district: attributes} }
  22. expect(block).to change { District.count }.by(1)
  23.  
  24. describe "create /district" do
  25. def create_district_request
  26. @district = build(:district)
  27. params = {district: {name: @district.name etc.}}
  28. post district_path, params: params
  29. end
  30.  
  31. it "creates a district" do
  32. expect {create_district_request}.to change{District.count}.by(1)
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement