@@ -4,6 +4,7 @@ module RubyCAS::Server::Core
4
4
describe RubyCAS ::Server ::Core ::Tickets do
5
5
let ( :client_hostname ) { 'myhost.test' }
6
6
let ( :username ) { 'myuser' }
7
+ let ( :service ) { 'https://myservice.test' }
7
8
8
9
before do
9
10
RubyCAS ::Server ::Core . setup ( "spec/config/config.yml" )
@@ -62,35 +63,29 @@ module RubyCAS::Server::Core
62
63
end
63
64
end
64
65
65
- describe "#generate_service_ticket(service, username, tgt)" do
66
- before do
67
- @username = 'testuser'
68
- @client_hostname = "myhost.test"
69
- @service = 'myservice.test'
70
- @tgt = @cas . generate_ticket_granting_ticket ( @username , @client_hostname )
71
- @st = @cas . generate_service_ticket ( @service , @username , @tgt , @client_hostname )
72
- end
66
+ describe ".generate_service_ticket(service, username, tgt)" do
67
+ let ( :tgt ) { Tickets . generate_ticket_granting_ticket ( username , client_hostname ) }
68
+ let ( :st ) { Tickets . generate_service_ticket ( service , username , tgt , client_hostname ) }
73
69
74
70
it "should return a ServiceTicket" do
75
- @ st. class . should == Tickets ::ServiceTicket
71
+ st . class . should == Tickets ::ServiceTicket
76
72
end
77
73
78
74
it "should not include the service identifer in the ticket string" do
79
- @ st. ticket . should_not match /#{ @ service} /
75
+ st . ticket . should_not match /#{ service } /
80
76
end
81
77
82
78
it "should not mark the ST as consumed" do
83
- @ st. consumed . should be_nil
79
+ st . consumed . should be_nil
84
80
end
85
81
86
82
it "must generate a ticket that starts with 'ST-'" do
87
- @ st. ticket . should match /^ST-/
83
+ st . ticket . should match /^ST-/
88
84
end
89
85
90
86
it "should assoicate the ST with the supplied TGT" do
91
- @ st. ticket_granting_ticket . id . should == @ tgt. id
87
+ st . ticket_granting_ticket . id . should == tgt . id
92
88
end
93
-
94
89
end
95
90
96
91
describe "#generate_proxy_ticket(target_service, pgt)" do
0 commit comments