Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it "increases count by 1" do
- attributes = attributes_for(:district)
- expect { post admin_districts_path, params: { district: attributes} }.to change { District.count }.by(1)
- end
- it "increases count by 1" do
- attributes = attributes_for(:district)
- block = { post admin_districts_path, params: { district: attributes} }
- expect(block).to change { District.count }.by(1)
- end
- syntax error, unexpected '}', expecting keyword_end
- it "increases count by 1" do
- attributes = attributes_for(:district)
- expect do
- post admin_districts_path, params: { district: attributes}
- end.to change { District.count }.by(1)
- end
- block = -> { post admin_districts_path, params: { district: attributes} }
- expect(block).to change { District.count }.by(1)
- describe "create /district" do
- def create_district_request
- @district = build(:district)
- params = {district: {name: @district.name etc.}}
- post district_path, params: params
- end
- it "creates a district" do
- expect {create_district_request}.to change{District.count}.by(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement