2015-11-08 09:41:11 +00:00
|
|
|
require "spec_helper"
|
2015-08-15 12:30:39 +00:00
|
|
|
|
|
|
|
describe PluginController do
|
|
|
|
render_views
|
|
|
|
|
2015-11-08 09:41:11 +00:00
|
|
|
describe "#user" do
|
2015-08-15 12:30:39 +00:00
|
|
|
before do
|
|
|
|
create :group, :donors
|
|
|
|
create :group, :champions
|
|
|
|
end
|
|
|
|
|
|
|
|
let!(:user) { create :user_with_team }
|
|
|
|
|
2015-11-08 09:41:11 +00:00
|
|
|
it "returns user data" do
|
2015-08-15 12:30:39 +00:00
|
|
|
get :user, id: user.steamid
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(response.body).to include(user.username)
|
|
|
|
end
|
|
|
|
|
2015-11-08 09:41:11 +00:00
|
|
|
it "definitely does not return IP address" do
|
|
|
|
last_ip = "127.0.0.1"
|
2015-08-15 12:30:39 +00:00
|
|
|
user.lastip = last_ip
|
|
|
|
user.save!
|
|
|
|
get :user, id: user.steamid
|
|
|
|
expect(response).to be_success
|
2015-11-08 09:41:11 +00:00
|
|
|
expect(response).to_not include(last_ip)
|
2015-08-15 12:30:39 +00:00
|
|
|
end
|
|
|
|
end
|
2015-11-08 09:41:11 +00:00
|
|
|
end
|